Closed momo-the-monster closed 1 year ago
Just put a sleep in testApp::exit() after calling stop() on the ofxOpenNI devices. That works for me. I imagine it's a typical threading issue where it takes a little bit of time to stop the thread but exit() is called right as the app quits, so things get deleted before the threads can finish.
I used sleep(2) for 2 seconds.
I'd suggest adding that to the addon itself as we do a similar thing in ofxKinect.
Actually, disabling the quit on escape key and writing your own handler works better:
//-------------------------------------------------------------- void testApp::setup() { ... ofSetEscapeQuitsApp(false); ... } //-------------------------------------------------------------- void testApp::exit(){ kinect.stop(); OF_EXIT_APP(0); } //-------------------------------------------------------------- void testApp::keyPressed(int key){ switch(key) { case 27: exit(); // call exit here to avoid thread error on app exit break; } }
Thanks for this, had this crash and this solution fixed it. Command Q will still crash it though, i hope there was an easier way.
Example projects with User Generators often crash on quit for me - OS X 10.7.5 using latest from Master.
The issue is usually:
libXnVFeatures_1_5_2.dylib 'NACommonData::Update():
This line: 0xc26c55 movl (%eax), %eax
Triggers this: Thread 11: EXC_BAD_ACCESS (code=2, address=0x0)
Any ideas what's going on?