Windsoarer
10th December 2008, 20:42
For somebody coming to Qt after several years of programming with MFC, one thing which is surprising is that objects created on the heap with "new" don't seem to require a "delete" instruction.
For instance, in the tabdialog example provided with the Qt library, the statement
tabWidget = new QTabWidget;
isn't followed by a statement
delete tabWidget
in the destructor ~TabDialog()
In MFC, this would cause a memory leak. Isn't this the case in QT ?
Is there some kind of built-in garbage collector ?
Thanks in advance for any insight
For instance, in the tabdialog example provided with the Qt library, the statement
tabWidget = new QTabWidget;
isn't followed by a statement
delete tabWidget
in the destructor ~TabDialog()
In MFC, this would cause a memory leak. Isn't this the case in QT ?
Is there some kind of built-in garbage collector ?
Thanks in advance for any insight