views:

46

answers:

1

I have a problem with objects not being deallocated.

It would be of great help if I could find out what objects are still referencing the object that should be deallocated.

How can I get such information?

A: 

If an object is not getting deallocated it is not because it is 'referenced' by another object, but because someone who had 'ownership' of the object did not 'release' it. This is called a 'memory leak'.

You can find out more by reading the Memory Management Programming Guide. Following the simple rules presented in the guide should help you avoid memory leaks.

For detecting memory leaks you could use Instruments.

I don't know of any app / tool that will show you which objects are referencing a particular object.

Florin
In our case it seems to be that it is still referenced by another object, since we do release our objects before reassigning.
Erik B
Besides, if we don't, it would be nice to detect that there are no references, but the reference counter is still > 0;
Erik B
@1st comment: maybe the other object that you are saying is 'referencing' yours is a AutoreleasePool (this may happen if your object is an autoreleased object)
Florin
@2nd comment: Instruments should help you find those objects with no references but with a reference count > 0
Florin
Our memory leaks are not detected as memory leaks as the objects are still referenced.
Erik B