diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index ac64a4fcc7..24829904c7 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -1208,6 +1208,8 @@ struct QueryWindow : public Window { * DeleteNonVitalWindows() to be called - we shouldn't be in a window then */ QueryCallbackProc *proc = this->proc; Window *parent = this->parent; + /* Prevent the destructor calling the callback function */ + this->proc = NULL; delete this; if (proc != NULL) { proc(parent, true);