I am using Delphi 2007 on Vista. I have the following defined:
TSettings = Class(TObject)
MySettings := TSettings.Create
MySettings := NIL;
if MySettings<>NIL then MySettings.Free
Everything works perfectly; however, ReportMemoryLeaksOnShutdown reports an unexpected memory leak with this code. I have tracked it down to the above but it escapes me as to how this is creating a memory leak.
Can anyone help?