views:

651

answers:

1

Hi everyone, I am new to C++ and have just started to work on a project using threading.

Currently my project involves the OpenGL and OpenCV libraries, and in the process of coding I encountered the following error :


Current language: auto; currently c++ 2009-12-21 14:54:49.438 3DTestApp[3210:7803] *** _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) kill quit


I put breakpoints and realised the error occurred only after the following line was executed:

cvShowImage("Motion Tracker", detectionMotionScreen); (this code was in a thread with infinite loop)

I have googled around and realised that this error only occurred in Objective C, and I found no results related to C++.

As such, I would wish to ask if anyone has any idea why has this occurred, and is there anyway to fix it?

edit : I have tried adding the framework Foundation to use NSAutoreleasePool, however upon compiliing it generates alot of errors in my codes with regards to the syntax, when actually there were none.

A: 

Apple doesn't have any public interfaces written in C++ outside of IOKit, so you're not going to find any. The procedural C documentation on CoreFoundation memory management is here.

If you want more specific help then you're going to need to describe what it is you're doing a lot more thoroughly.

Azeem.Butt
Hi, NSD,Thanks for your reply.For my application, it involves drawing lines with every motion detected. In my main method, I created a thread that runs a method in a loop that detects motion from a camera and draws lines on an IplImage. The IplImage is then show on the screen by calling the cvShowImage at the end of the loop before it is being cleared by cvZero at the top of the look and the motion detection codes get executed again.The IplImage that it uses is declared at the start of the class as a goal variable, and initialized in the main method.
Freeman Ang