1

while first time debugging i got this error in console and crashed

* -[NSPathStore2 release]: message sent to deallocated instance 0x7052210

dipak
  • 135
  • 4
  • 13

3 Answers3

2

It means you are trying to release the NSPathStore2 object that has already been released.

Without seeing the codebase it's difficult to pinpoint but usually it's because the code has done something like

NSPathStore2 = [[NSPath alloc]init]autorelease];

... (later in app) ... [NSPathStore2 release];

The alloc line allocates the object but puts the ref count to 0, meaning it will be freed by the system at somepoint later in the loop (I assume after a frame), unless something else retain's it. When you call release later the object has already been released by the system. The solution is to not use autorelease or retain the object yourself.

Also helper functions that start with the class name, e.g. NSString methods like stringWithString or stringWithFormat... these create a String object and return it with a retain count of 0 like the example above... i.e. you'd need to retain the object to avoid the system freeing it automatically for you later.

This link has some good guide on memory management worth a read...

http://iosdevelopertips.com/objective-c/memory-management.html

Cœur
  • 37,241
  • 25
  • 195
  • 267
sradforth
  • 2,176
  • 2
  • 23
  • 37
1

I think you are trying to access some released object. Check which line of your code has the problem, if there any release, that will be the reason.

itZme
  • 1,439
  • 9
  • 14
  • i am not able to find out exactly which line can i got the object 0x7052210 this instance – dipak Feb 28 '11 at 11:37
  • See point number 4 from following link. It might help you to get the object. http://aspirement.com/2009/09/mastering-cocoa-memory-management-on-the-iphone/ – Vaibhav Tekam Feb 28 '11 at 11:59
0

Try enabling Zombie.It will help you in finding which object is being released again.

Swastik
  • 2,415
  • 2
  • 31
  • 61