Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 369
Dani Avatar asked Dec 10 '11 02:12

Dani


1 Answers

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.

like image 92
Firoze Lafeer Avatar answered Sep 18 '22 17:09

Firoze Lafeer