Skip to content

Commit

Permalink
removed callback on exit as it makes the app to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
roymacdonald committed Jul 19, 2023
1 parent aa3975b commit ebacf7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/ofxSoundObject.cpp
Expand Up @@ -14,16 +14,16 @@
//--------------------------------------------------------------
ofxSoundObject::ofxSoundObject() {
ofLogWarning("ofxSoundObject::ofxSoundObject()", "the ofxSoundObjects' no args constructor should not be called. ");
ofAddListener(ofEvents().exit, this, &ofxSoundObject::onExit);
// ofAddListener(ofEvents().exit, this, &ofxSoundObject::onExit);
}
ofxSoundObject::ofxSoundObject(ofxSoundObjectsType t){
type = t;

ofAddListener(ofEvents().exit, this, &ofxSoundObject::onExit);
// ofAddListener(ofEvents().exit, this, &ofxSoundObject::onExit);

}
ofxSoundObject::~ofxSoundObject() {
ofRemoveListener(ofEvents().exit, this, &ofxSoundObject::onExit);
// ofRemoveListener(ofEvents().exit, this, &ofxSoundObject::onExit);
disconnect();
}
//--------------------------------------------------------------
Expand Down Expand Up @@ -161,10 +161,10 @@ void ofxSoundObject::setName(const std::string& name){
objectName = name;
}

//--------------------------------------------------------------
void ofxSoundObject::onExit(ofEventArgs&){
disconnect();
}
////--------------------------------------------------------------
//void ofxSoundObject::onExit(ofEventArgs&){
// disconnect();
//}


//--------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/ofxSoundObject.h
Expand Up @@ -129,7 +129,7 @@ class ofxSoundObject: public ofBaseSoundOutput {

// listener to disconnect upon exit to avoid crash
// ofEventListener exitListener;
void onExit(ofEventArgs&);
// void onExit(ofEventArgs&);
};

//--------------------------------------------------------------
Expand Down

0 comments on commit ebacf7b

Please sign in to comment.