No. Leaks also occur when you allocate external memory, not managed by GCC and don't free it again. You may not be doing this, of course.
Incidentally, you don't normally have to "set it to null" to destroy an object. You just have to stop using it, remove it from a container, or let it go out of scope. If you have cyclic references ( two objects both of which reference each other ) then you will need to manually null one to break the cyclic dependency and allow one ( then the other will automatically follow ) to be collected.
Incidentally, you don't normally have to "set it to null" to destroy an object. You just have to stop using it, remove it from a container, or let it go out of scope. If you have cyclic references ( two objects both of which reference each other ) then you will need to manually null one to break the cyclic dependency and allow one ( then the other will automatically follow ) to be collected.