On 7 July 2010 00:09, Andrew Brunner wrote: >> > Whew, Ok. Years back Delphi (the experience I'm drawing on) > Object.Free could not be done. Now that I know FPC does the check for > nil I probably won't be using FreeAndNil anymore. But this raises a > large concern for me. That is the EXTRA if statement being called for > every destruction of every object will lead to a decrease in high
Delphi and Kylix has done the exact same thing for years. In this case FPC is just Delphi compatible. As for the extra check causing a hit in performance - I can't say I have ever noticed it in our projects where we often create and destroy 80,000+ objects. It's a safety net, and a handy one. Maybe you can put together a speed test app and post your results. One test calls .Free, the other test calls .Destroy -- Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal