[fpc-pascal] TIniFile crash/memory loss

José Mejuto joshyfun at gmail.com
Thu Mar 31 18:08:25 CEST 2011


Hello FPC-Pascal,

Thursday, March 31, 2011, 5:05:35 PM, you wrote:

>> Should I report this behaviour as a bug, or is it considered "by design"?
>> (My old Delphi does not support the CacheUpdates property, so I cannot
>> test how it behaves in Delphi)
mvwb> Please report it as a bug. Your fix proposal is good.

I think the fix is not good, eat an exception is not good at all, so I
think better:

destructor TIniFile.destroy;
begin
  try
    If FDirty and FCacheUpdates then
    begin
      UpdateFile;
    end;
  finally
    inherited destroy;
  end;
end;

Silently not updating the file seems to be a no-no.

-- 
Best regards,
 José




More information about the fpc-pascal mailing list