Thats unreliable method, you can have less memory available after releasing the objects, because some background app could use it.And one way to find out if the objects are destroyed is by finding out the heap memory size, before the object is created and the size after it was destroyed
If those objects are QObject-based you can connect to "destroyed()" signal. If not, use some kind of reference-counting to track down the number of existing objects.
Bookmarks