0

I long time coding in RAD Studio (C++ Builder) but today im confused. My application got crash when i call Free() method from TStringList class. But when i removed Free() calling - all works fine.

I dont understand few things. 1) If we call new then we must call delete, im right? So for what Free() method in TStringList class? 2) How to correctly remove TStringList (and other controls) from memory 3) Does Embarcadero use for it smart pointer? If "yes" then it change everything.

user922871
  • 435
  • 2
  • 6
  • 17
  • show some code that produces the error, otherwise it's difficult to understand what's going on. – Ashalynd Oct 29 '13 at 21:22
  • 1
    read the [documentation](http://docwiki.embarcadero.com/Libraries/XE3/en/System.TObject.Free). It clearly says that `NewInstance()` and `Free()` are called by the constructor and destructor respectively. I quote: `Note: In C++ code, do not use Free to destroy an object. Use the delete keyword.`. – PeterT Oct 29 '13 at 21:40
  • Thanks PeterT. Your link help me – user922871 Oct 30 '13 at 05:17

0 Answers0