Deregister a linked widget upon destruction.
Crab_ noticed odd crashes in some of his new code, which caused by accessing the widgets after destruction.
This commit is contained in:
parent
2b3e8cc06d
commit
f77ae6ba00
1 changed files with 8 additions and 2 deletions
|
@ -49,8 +49,14 @@ twidget::~twidget()
|
|||
DBG_GUI_LF << "widget destroy: " << (void*)this
|
||||
<< " (id: " << id_ << ", definition: " << definition_ << ")\n";
|
||||
|
||||
if(tevent_handler* event_handler = get_window()) {
|
||||
event_handler->remove_widget(this);
|
||||
twindow* window = get_window();
|
||||
if(!window) {
|
||||
return;
|
||||
}
|
||||
|
||||
window->remove_widget(this);
|
||||
if(!linked_group_.empty()) {
|
||||
window->remove_linked_widget(linked_group_, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue