aboutsummaryrefslogtreecommitdiff
path: root/gui/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/options.cpp')
-rw-r--r--gui/options.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index 7a22a9ba3f..179fa65991 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -423,7 +423,10 @@ void OptionsDialog::clean() {
while (_firstWidget) {
Widget* w = _firstWidget;
removeWidget(w);
- delete w;
+ // This is called from rebuild() which may result from handleCommand being called by
+ // a child widget sendCommand call. In such a case sendCommand is still being executed
+ // so we should not delete yet the child widget. Thus delay the deletion.
+ g_gui.addToTrash(w, this);
}
init();
}