File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
libs/ofxLibwebsockets/src Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,12 @@ namespace ofxLibwebsockets {
5959 void Reactor::exit (){
6060 if (context != NULL )
6161 {
62- waitForThread (true );
62+ if (isThreadRunning ()){
63+ // this is the strategy from ofxKinect
64+ stopThread ();
65+ ofSleepMillis (10 );
66+ waitForThread (false );
67+ }
6368 // on windows the app does crash if the context is destroyed
6469 // while the thread or the library still might hold pointers
6570 // better to live with non deleted memory, or?
Original file line number Diff line number Diff line change @@ -141,7 +141,12 @@ namespace ofxLibwebsockets {
141141
142142 // --------------------------------------------------------------
143143 void Server::close () {
144- waitForThread (true );
144+ if (isThreadRunning ()){
145+ // this is the strategy from ofxKinect
146+ stopThread ();
147+ ofSleepMillis (10 );
148+ waitForThread (false );
149+ }
145150 libwebsocket_context_destroy (context);
146151 }
147152
You can’t perform that action at this time.
0 commit comments