On Tue, Jul 6, 2010 at 5:09 PM, Graeme Geldenhuys <graemeg.li...@gmail.com> wrote: > Even with a try..except, if you call MyObj.Free and it causes an > exception, you are screwed either way and it will always cause a > memory leak. Best is no notify the user some how, or crash out of the > program, or fire the programmer for not writing enough unit tests. :)
No, if the nesting is done properly you could guarantee that Obj2.Free would be called even if Obj1.Free failed with some exception. And further, nested exception handling offers safeguarding against such memory leaks during destruction if done properly. To me this is the difference between good software and great software... How well it handles exceptions. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal