Ive got a memory leak in the following code, and after months iv still havent been able to fix it. ive just been ignoring it so far, but i really need to get it fixed. In the dealloc i have commented out CGImageRelease(scratchable) as if i leave it in the app crashes. comment it out and it doesnt crash, but theres a leak. im not sure if thats the cause or not.
Ive got a memory leak in the following code, and after months iv still havent been able to fix it. ive just been ignoring it so far, but i really need to get it fixed. In the dealloc i have commented out CGImageRelease(scratchable) as if i leave it in the app crashes. comment it out and it doesnt crash, but theres a leak. im not sure if thats the cause or not.
its quite possible thats the issue.. i tried putting CFRelease(pixels); at the end of the init method, didnt fix the issue. but also im not sure ive done it right, im not sure if CFRelease is the right thing to use, but its the best i could find. theres still a leak.
its quite possible thats the issue.. i tried putting CFRelease(pixels); at the end of the init method, didnt fix the issue. but also im not sure ive done it right, im not sure if CFRelease is the right thing to use, but its the best i could find. theres still a leak.
Well, then my tip is: comment out as much as possible. make an empty init, test it. And then uncomment one or a few lines per run. That will make it easy to isolate the leak.
Well, then my tip is: comment out as much as possible. make an empty init, test it. And then uncomment one or a few lines per run. That will make it easy to isolate the leak.
perfect! i should have thought of that... i could comment out pixels as everything refers to it. but i commented out most of the rest of the code, turned pout to be the variable scratched. i then added CGImageRelease(scratched); to my dealloc and its all good now. thanks! i think that was the last memory leak in my app. i cant find any others