diff -r 5425d6526d6e -r bf4e3ff4cf16 src/window.cpp --- a/src/window.cpp Wed Sep 24 14:01:49 2008 +0000 +++ b/src/window.cpp Wed Sep 24 16:40:06 2008 +0000 @@ -392,6 +392,18 @@ } /** + * Delete all children a window might have in a head-recursive manner + */ +void Window::DeleteChildWindows() const +{ + Window *child = FindChildWindow(this); + while (child != NULL) { + delete child; + child = FindChildWindow(this); + } +} + +/** * Remove window and all its child windows from the window stack. */ Window::~Window() @@ -414,12 +426,7 @@ memmove(wz, wz + 1, (byte*)_last_z_window - (byte*)wz); _last_z_window--; - /* Delete all children a window might have in a head-recursive manner */ - Window *child = FindChildWindow(this); - while (child != NULL) { - delete child; - child = FindChildWindow(this); - } + this->DeleteChildWindows(); if (this->viewport != NULL) DeleteWindowViewport(this);