-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup the error handling in rcl_node_init. #1099
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having the inverted water fall order to finalize with goto
statement works and do only necessary finalization. on the other hand, it would be complicated to add the process afterwards not to miss the correct jump point for code maintenance. (this could easily go to memory leak issue.)
i would prefer the single failing jump point and check if what is necessary to call with current implementation.
That's fair. While this definitely cleans some things up, maybe it isn't the best strategy (even if I find it to be the easiest to understand). Let me try something else here. |
Only undo things that we've done before. Not only does this result in less code, it also avoids spurious warnings from trying to cleanup things that we haven't initialized. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
54163ca
to
434c780
Compare
All right, I've totally revamped this to go another direction. In particular, I keep the |
Only undo things that we've done before. Not only does this result in less code, it also avoids spurious warnings from trying to cleanup things that we haven't initialized.