(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.
This commit is contained in:
Darkvater
2006-11-18 16:47:02 +00:00
parent b2a5b4f069
commit c01c294afb
7 changed files with 298 additions and 230 deletions

View File

@@ -148,9 +148,10 @@ assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d));
void RebuildStationLists(void)
{
Window *w;
Window* const *wz;
for (w = _windows; w != _last_window; ++w) {
FOR_ALL_WINDOWS(wz) {
Window *w = *wz;
if (w->window_class == WC_STATION_LIST) {
WP(w, plstations_d).flags |= SL_REBUILD;
SetWindowDirty(w);
@@ -160,9 +161,10 @@ void RebuildStationLists(void)
void ResortStationLists(void)
{
Window *w;
Window* const *wz;
for (w = _windows; w != _last_window; ++w) {
FOR_ALL_WINDOWS(wz) {
Window *w = *wz;
if (w->window_class == WC_STATION_LIST) {
WP(w, plstations_d).flags |= SL_RESORT;
SetWindowDirty(w);