We are developing an application using the LeapMotion SDK in VS2012 Express for desktop using C#. Therein we add a listener thread to the Leap Controller object. As so:
Controller objcontroller = new Controller();
Listener objlistener = new LeapListener();
objcontroller.AddListener(objlistener);
The controller object does a callback of overridden methods like OnFrame()
etc.
The problem is the listener thread exits automatically after certain number of callbacks which range from 3000 to 5500. The output window shows the following text:
The thread (0x1614) has exited with code 0 (0x0).
LeapMotion is a motion detection device which reports frames at a rate of upto 100 fps. When a frame is detected the OnFrame()
method gets called.
We tried using try catch.. and no exceptions are thrown - since exit code is 0. I feel the memory consumption is getting exceeded which causes the compiler to shutdown the thread.
Any ideas on this would be helpful.
Platform target is x86 and .net framework target is 4.0