Monday, December 21, 2009

Week 13 Day 1

Today I have successfully fixed the memory issue by making 2 IplImages variable gobal and hence preventing them from being needed to be declared in the thread.

Another changes I made that fix the memory leak would be changing one of my method in the loop of a thread, from taking in parameters to not taking in any parameters (just using and modifying the variables globally.

However, I encountered a setback. While I was using the "Leak" performance tool to check for leak again, it crashed around 3 seconds after the application has launched. I take a look at the debugger and saw this :

2009-12-21 16:08:37.962 3DTestApp[4067:7903] *** _NSAutoreleaseNoPool(): Object 0x10ebe0 of class NSCFNumber autoreleased with no pool in place - just leaking

Stack: (0x91edff4f 0x91dec432 0x941ad394 0x94282218 0x94281b32 0x94528023 0x942813ef 0x94280dc6 0x94489ef4 0x944882ab 0x9350e13d 0x9350d57b 0x9350d3e0 0x93529e29 0x93529bce 0x935292a8 0x935290e4 0x5743e2)

3DTestApp(4067,0xa0310720) malloc: *** error for object 0xffffffff: Non-aligned pointer being freed

I did a search and realised that this has got to do with objective C and the solution for Objective C was to use a class called NSAutoreleasePool, which I tried and when implemented it gives lots of syntax errors with the codes, when there were no syntax errors in C++. I have posted this question on various forums, and seeking for answers to it now.

http://stackoverflow.com/questions/1938777/class-nscfnumber-autoreleased-with-no-pool-in-place-just-leaking

No comments:

Post a Comment