tonnot, consider the difference:
if (!somefunction()) {
//clean up
return;
}
if (!someOtherfunction()) {
// clean up
return;
}
// etc.
if (!somefunction()) {
//clean up
return;
}
if (!someOtherfunction()) {
// clean up
return;
}
// etc.
To copy to clipboard, switch view to plain text mode
with the functions themselves also having cleanup code...
and
try {
somefunction();
someOtherfunction();
} catch (someException &e) {
// cleanup, knowing what went wrong.
}
try {
somefunction();
someOtherfunction();
} catch (someException &e) {
// cleanup, knowing what went wrong.
}
To copy to clipboard, switch view to plain text mode
Much nicer.
Bookmarks