Daniel
Daniel

Reputation: 31579

Object with retain count 0 doesn't get released

Why is my object in the following leak trace doesn't get released?
enter image description here
The trace says its reference count is 0, so why doesn't it get released?
The object is a custom class that derives directly from NSObject. all I do with it is alloc it, init it, copy some strings/numbers from it, and send release, but still its considered a leak and doesn't get deallocated. I see it under allocations in instruments as 'living' so its really not deallocated. I create hundreds of these objects, so I cannot allow them to live.
How can I make this object get deallocated? why isn't it deallocated in the first place?

Upvotes: 6

Views: 632

Answers (1)

Firoze Lafeer
Firoze Lafeer

Reputation: 17143

Well, it looks like you forgot to call [super dealloc] in your -dealloc method. We've all done that. :)

So the object is getting the dealloc call as you would expect, but isn't actually being deallocated.

Upvotes: 9

Related Questions