File tree Expand file tree Collapse file tree
libs/oscpack/src/ip/posix
apps/devApps/StressofxOscReceiver/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656#include < cstring> // for memset
5757#include < stdexcept>
5858#include < vector>
59+ #include < atomic>
5960
6061#include " ip/PacketListener.h"
6162#include " ip/TimerListener.h"
Original file line number Diff line number Diff line change @@ -96,19 +96,11 @@ bool ofxOscReceiver::start() {
9696 }
9797 });
9898
99- // detach thread so we don't have to wait on it before creating a new socket
100- // or on destruction, the custom deleter for the socket unique_ptr already
101- // does the right thing
102-
103- #ifndef OSC_NO_DETACH
104- listenThread.detach ();
105- #endif
10699 return true ;
107100}
108101
109102// --------------------------------------------------------------
110103void ofxOscReceiver::stop () {
111- #ifdef OSC_NO_DETACH
112104 if (listenSocket) {
113105 listenSocket->AsynchronousBreak ();
114106 } else {
@@ -120,7 +112,6 @@ void ofxOscReceiver::stop() {
120112 } else {
121113 listenThread.join ();
122114 }
123- #endif
124115 listenSocket.reset ();
125116}
126117
Original file line number Diff line number Diff line change 11#include " ofApp.h"
22
3- #define USE_EXPLICIT_FUNCTION 1
3+ // #define USE_EXPLICIT_FUNCTION 1
44
55#define INSTANTLY_OUT_OF_SCOPE 1
66
@@ -11,8 +11,9 @@ void ofApp::setup(){
1111 ofSetVerticalSync (false );
1212
1313#ifdef INSTANTLY_OUT_OF_SCOPE
14- ofLogNotice (" will hang" );
15- ofxOscReceiver r;
14+ ofLogNotice (" will hang if thread problem" );
15+ std::unique_ptr<ofxOscReceiver> r = std::make_unique<ofxOscReceiver>();
16+ r = std::make_unique<ofxOscReceiver>();
1617#endif
1718 ofLogNotice (" ready to roll" );
1819
You can’t perform that action at this time.
0 commit comments