iPhone development: pointer being freed was not allocated

前端 未结 7 1832
粉色の甜心
粉色の甜心 2020-12-02 12:33

i got this message from the debugger:

Pixture(1257,0xa0610500) malloc: *** error for object 0x21a8000: pointer being freed was not allocated
*** set a breakpo         


        
相关标签:
7条回答
  • 2020-12-02 13:22

    I've struggled with the same error in my code. What I was puzzled by is that my app worked in OS 3.0 without any problem until I made a minor modification to a code that has nothing to do with the CGImage* stuff. But once it started to fail, then it never worked without crashing. When I switched to 3.1, everything worked again. I narrowed down the error to a CGImageRelease() call. Either removing that line or adding a retain on the resulting UIImage resolved the problem--although this is a no solution since the app will be leaking memory.

    I tried using NSZombie with instruments. This didn't help--the app crashed without any zombies being detected.

    Furthermore, Apple's own example apps (like TheElements) does NOT crash but uses the same EXACT code as my app. So, I'm struggling to accept the problem lies in the Frameworks. For now, I am switching to 3.1 and moving on.

    0 讨论(0)
提交回复
热议问题