aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/container.cpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-03-22 22:49:14 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-13 22:40:51 +0100
commitb44ac46e4e54f228fd9c25c042da2efd2ab45b64 (patch)
tree558fe562a65f7608485fd0453f2f0403b3a73fb2 /src/menu/container.cpp
parentce83bbe3db755828faea0490ede53f8889ba0254 (diff)
downloadusdx-b44ac46e4e54f228fd9c25c042da2efd2ab45b64.tar.gz
usdx-b44ac46e4e54f228fd9c25c042da2efd2ab45b64.tar.xz
usdx-b44ac46e4e54f228fd9c25c042da2efd2ab45b64.zip
menu/container: cleanup while destruction of container
while a container is destructed, the parent of all containing controls will be removed, so that the controls it self do not try to unregister itself from the destroyed container later (while destruction the control class of the container and destroying all slave controls)
Diffstat (limited to 'src/menu/container.cpp')
-rw-r--r--src/menu/container.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/menu/container.cpp b/src/menu/container.cpp
index 4ac26548..795d57ab 100644
--- a/src/menu/container.cpp
+++ b/src/menu/container.cpp
@@ -46,6 +46,11 @@ namespace usdx
Container::~Container()
{
+ for (std::list<DrawableControl*>::iterator next = controls.begin(), it = next++;
+ it != controls.end(); it = next++) {
+ (*it)->remove_parent();
+ }
+
controls.clear();
}