Quote from MSDN:
If Finalize or an override of Finalize throws an exception, the runtime ignores the exception, terminates that Finalize method, and continues the finalization process.
Yet if I have:
~Person()
{
throw new Exception("meh");
}
then it results in a runtime exception?
p.s. I know that this should never happen, however I'm just curious around this behaviour. One of our clients had an empty try catch around all of their finalizers.. it didn't even log when things went wrong or reserect the object :/
close()
method that the client code never calls, then your destructor/finalizer must do the cleanup. – Heffner