On Fri, Apr 1, 2011 at 6:28 AM, José Mejuto <joshy...@gmail.com> wrote: > An exception in free is an extreme rare condition, but it could > happend, and is better that your software stops to work than notify 2 > years later that your 2 zillions of INI files were not written at all > because the user write a non valid file path.
The test case was an invalid filename. Is this the primary failure method? If so, then check this in the create, or the first write, (or check any other reasons why writing to the file would fail) and throw the exception there. Then you should rarely if ever get to the destructor with an unwritable file. Sure, someone could change the permissions on you between the create and the destroy, but how likely is that? Jeff. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal