diff options
author | Darkvater <darkvater@openttd.org> | 2006-12-30 01:08:12 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-12-30 01:08:12 +0000 |
commit | a64f7dc354572a4e60c8b8f28e04759c9621877d (patch) | |
tree | 13f826d8c6dce81a4613bf08ea1ebd6b2231fa0e /misc_gui.c | |
parent | 662e25dded06cf852261d3af6202d54916dccb42 (diff) | |
download | openttd-a64f7dc354572a4e60c8b8f28e04759c9621877d.tar.xz |
(svn r7635) -Fix (r7618, r7621): Guard against recursive deletion. It is possible that when a
parent window is deleted it deletes its child (always) and in turn, through some
code the child initiates the deletion of the parent which, if not guarded
against, deletes the child and so on...
Diffstat (limited to 'misc_gui.c')
-rw-r--r-- | misc_gui.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/misc_gui.c b/misc_gui.c index 2f2a8d3bf..92ba1b4fa 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -1226,7 +1226,10 @@ static void QueryWndProc(Window *w, WindowEvent *e) break; case WE_DESTROY: /* Call callback function (if any) on window close if not yet called */ - if (!q->calledback && q->proc != NULL) q->proc(w->parent, false); + if (!q->calledback && q->proc != NULL) { + q->calledback = true; + q->proc(w->parent, false); + } break; } } |