RAII - if the language has it - is usually the best way to free resources at the end of a function. But if you have to free them manually, many modern languages have a try...finally construct:
This will guarantee that no matter where which return statement ends the function, and even if there was an exception somewhere - delete checker will be invoked.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
RAII - if the language has it - is usually the best way to free resources at the end of a function. But if you have to free them manually, many modern languages have a
try...finally
construct:This will guarantee that no matter where which
return
statement ends the function, and even if there was an exception somewhere -delete checker
will be invoked.