Change window allocation/destruction to avoid undefined behaviour

Create a new window base class which holds the front/back pointers
and the window class.
This fixes the voluminous warning spam about deleted windows when using
UndefinedBehaviorSanitizer.
This commit is contained in:
Jonathan G Rennison
2018-06-06 18:14:51 +01:00
parent d8ab61cab3
commit 6573a67b69
4 changed files with 83 additions and 19 deletions

View File

@@ -480,7 +480,7 @@ static void SetViewportPosition(Window *w, int x, int y, bool force_update_overl
i = top + height - _screen.height;
if (i >= 0) height -= i;
if (height > 0) DoSetViewportPosition(w->z_front, left, top, width, height);
if (height > 0) DoSetViewportPosition((const Window *) w->z_front, left, top, width, height);
}
}