summaryrefslogtreecommitdiff
path: root/window.h
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-18 16:47:02 +0000
committerDarkvater <darkvater@openttd.org>2006-11-18 16:47:02 +0000
commitb3c48c0a84323838b5104e422d11b8a1250325c8 (patch)
tree8112ec497b55f459780ad628193295c31cabfe28 /window.h
parentaa97b61a27cecfb6e06526fa74d95629cc7259a5 (diff)
downloadopenttd-b3c48c0a84323838b5104e422d11b8a1250325c8.tar.xz
(svn r7205) -Fix [FS#350, SF#1560913]: Window allocation and deletion messed with the actual window
structs inside their array, and possibly invalidating pointers higher up. Meaning that any function called within an wndproc could cause unknown/invalid pointers once control was returned to this function. Solved by the introduction of an extra abstraction layer, an array of z-window positions that is only concerned with the pointers.
Diffstat (limited to 'window.h')
-rw-r--r--window.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/window.h b/window.h
index 5b2738e5a..1c1aed22c 100644
--- a/window.h
+++ b/window.h
@@ -833,10 +833,12 @@ void DeleteNonVitalWindows(void);
void DeleteAllNonVitalWindows(void);
void HideVitalWindows(void);
void ShowVitalWindows(void);
+Window **FindWindowZPosition(const Window *w);
/* window.c */
-VARDEF Window _windows[25];
-VARDEF Window *_last_window;
+extern Window *_z_windows[];
+extern Window **_last_z_window;
+#define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
VARDEF Point _cursorpos_drag_start;