rezaali / ofxUI

[DEPRECATED] UI Addon for openFrameworks
http://www.syedrezaali.com/#/ofxui-project-showcase/
518 stars 202 forks source link

Removing ofxUIDropDownList causes malloc error #211

Open genekogan opened 10 years ago

genekogan commented 10 years ago

Trying to remove toggles from an ofxUIDropDownList or removing the DropDownList itself causes application to crash. For example:

gui = new ofxUICanvas("canvas");
gui->setWidth(300);

vector<string> items;
items.push_back("this");
items.push_back("that");

ofxUIDropDownList *dd = gui->addDropDownList("dropdown", items);

dd->removeToggle("this");

The stack trace starts with an attempt to delete pointer rect inside the destructor ofxUIWidget::~ofxUIWidget() and gives the following:

mySketchDebug(23104,0xac89c2c0) malloc: * error for object 0xd347b0: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug (lldb)

Same thing happens when trying to remove all toggles at same time, e.g. dd->removeToggles() or trying to just delete the whole widget from gui altogether, e.g. gui->removeWidget("dropdown" or gui->removeWidget(dd).