summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-06-03 20:00:33 +0000
committeralberth <alberth@openttd.org>2009-06-03 20:00:33 +0000
commit1ba3755aa7383c34042f781c85a28f76417962cd (patch)
treefe4f24c20a367e5f0d53e64b5107ea6a8d6c8446 /src/window.cpp
parentcaf98238e3cffedbc80fc9f7aa0f485500f6913a (diff)
downloadopenttd-1ba3755aa7383c34042f781c85a28f76417962cd.tar.xz
(svn r16513) -Codechange: Add nested widgets root and array to Window, and NWidgetBase::FillNestedArray() to fill the array.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 5fbaac72e..d2a493fe2 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -563,6 +563,8 @@ Window::~Window()
this->SetDirty();
free(this->widget);
+ free(this->nested_array); // Contents is released through deletion of #nested_root.
+ delete this->nested_root;
this->window_class = WC_INVALID;
}
@@ -789,6 +791,8 @@ static void AssignWidgetToWindow(Window *w, const Widget *widget)
void Window::Initialize(int x, int y, int min_width, int min_height,
WindowClass cls, const Widget *widget, int window_number)
{
+ /* All data members of nested widgets have been set to 0 by the #ZeroedMemoryAllocator base class. */
+
/* Set up window properties */
this->window_class = cls;
this->flags4 = WF_WHITE_BORDER_MASK; // just opened windows have a white border