Permalink
Browse files

fixed crash on exit where name check fails

  • Loading branch information...
1 parent 901e409 commit 76e6be0f82e599eace294257680bf5c085ac993c @danomatika danomatika committed Feb 18, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ofxControlPanel.cpp
View
@@ -43,8 +43,8 @@ ofxControlPanel::~ofxControlPanel(){
guiObjects.clear();
for(int i = 0; i < ofxControlPanel::globalPanelList.size(); i++){
- if( ofxControlPanel::globalPanelList[i] != NULL && ofxControlPanel::globalPanelList[i]->name == name ){
- ofxControlPanel::globalPanelList.erase( ofxControlPanel::globalPanelList.begin()+i, ofxControlPanel::globalPanelList.begin()+i+1);
+ if( ofxControlPanel::globalPanelList[i] != NULL && ofxControlPanel::globalPanelList[i] == this ){
+ ofxControlPanel::globalPanelList.erase(ofxControlPanel::globalPanelList.begin()+i, ofxControlPanel::globalPanelList.begin()+i+1);
break;
}
}

0 comments on commit 76e6be0

Please sign in to comment.