4 ms·
Very true. If you include FastMM in your project use-after-free is trapped along with other memory errors. I find the allocate / try / finally / free paradigm
by chadcmulligan 2y ago
Very true. If you include FastMM in your project use-after-free is trapped along with other memory errors.
I find the allocate / try / finally / free paradigm in Delphi makes things easier, it just becomes a habit.
eg
var obj := TMyObject.Create
try
...do stuff
finally
obj.free //(or for bonus points freeandnil(obj))
end;