QList and garbage collection
Hi,
I have;
And I have two seperate lists that hold address of the obj.
I want to ask that, does QList clear, removeAt, removeAll etc. methods deletes the object itself or reference?
If so, how Qt deletes the obj? By keeping reference(s) on it?
Thanks
Re: QList and garbage collection
They are not getting deleted. You have to take care about that yourself. clear() just clears the list. If you also want to delete the stored items see qDeleteAll().
Re: QList and garbage collection
So you say only references in the list are being removed?
Well, what qt garbage collector does then? Is there any of it actually?
Re: QList and garbage collection
Yes, and Qt does not have a gc like Java. Qt does only delete the children of a QObject when it gets destroyed.