[fpc-pascal] TIniFile crash/memory loss
DaWorm
daworm at gmail.com
Fri Apr 1 16:21:27 CEST 2011
On Fri, Apr 1, 2011 at 9:09 AM, Bart <bartjunk64 at gmail.com> wrote:
>> The test case was an invalid filename. Is this the primary failure
>> method?
>
> This was merely to demonstrate the possibility of the destructor failing.
What other things would make the destructor of the TIniFile fail? It
seems to me like a lot of effort to trap something that will rarely
happen. You can check for the likely things to go wrong up front
(invalid filename, path doesn't exist, no write permissions, disk
quota full, whatever else seems likely), and that would eliminate
almost anything that could possibly go wrong later (for this
particular component), apart from the aforementioned someone messing
with the file system behind your back. Sure, it isn't "complete", but
it is probably "sufficient".
Jeff.
More information about the fpc-pascal
mailing list