From: Thomas Geymayer Date: Sat, 7 Dec 2013 12:40:22 +0000 (+0100) Subject: Canvas: ensure all canvasses are destroyed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2c3f44ae118cacc2ab71ab55b76f1d646f3dbfe1;p=simgear.git Canvas: ensure all canvasses are destroyed - For shutdown/reset make sure all properties describing a canvas are removed and also not restored after the reset. --- diff --git a/simgear/canvas/Canvas.cxx b/simgear/canvas/Canvas.cxx index a8eab722..28fa521e 100644 --- a/simgear/canvas/Canvas.cxx +++ b/simgear/canvas/Canvas.cxx @@ -74,6 +74,12 @@ namespace canvas setStatusFlags(MISSING_SIZE_X | MISSING_SIZE_Y); } + //---------------------------------------------------------------------------- + Canvas::~Canvas() + { + + } + //---------------------------------------------------------------------------- void Canvas::onDestroy() { diff --git a/simgear/canvas/Canvas.hxx b/simgear/canvas/Canvas.hxx index 0173d8eb..6857d61d 100644 --- a/simgear/canvas/Canvas.hxx +++ b/simgear/canvas/Canvas.hxx @@ -71,6 +71,7 @@ namespace canvas typedef osg::ref_ptr CullCallbackPtr; Canvas(SGPropertyNode* node); + virtual ~Canvas(); virtual void onDestroy(); void setSystemAdapter(const SystemAdapterPtr& system_adapter); diff --git a/simgear/props/PropertyBasedMgr.cxx b/simgear/props/PropertyBasedMgr.cxx index 4091da9f..7d868d37 100644 --- a/simgear/props/PropertyBasedMgr.cxx +++ b/simgear/props/PropertyBasedMgr.cxx @@ -36,8 +36,8 @@ namespace simgear //---------------------------------------------------------------------------- void PropertyBasedMgr::shutdown() { + _props->removeAllChildren(); _props->removeChangeListener(this); - _elements.clear(); } //---------------------------------------------------------------------------- @@ -96,7 +96,7 @@ namespace simgear _name_elements( name_elements ), _element_factory( element_factory ) { - + _props->setAttribute(SGPropertyNode::PRESERVE, true); } //----------------------------------------------------------------------------