]> git.mxchange.org Git - simgear.git/commitdiff
Canvas: ensure all canvasses are destroyed
authorThomas Geymayer <tomgey@gmail.com>
Sat, 7 Dec 2013 12:40:22 +0000 (13:40 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Sat, 7 Dec 2013 12:40:22 +0000 (13:40 +0100)
 - For shutdown/reset make sure all properties describing a canvas
   are removed and also not restored after the reset.

simgear/canvas/Canvas.cxx
simgear/canvas/Canvas.hxx
simgear/props/PropertyBasedMgr.cxx

index a8eab7227e1905422e67b6edb87108500fa0b2bf..28fa521e026a03b5eecdf3c22a02164b4c80638b 100644 (file)
@@ -74,6 +74,12 @@ namespace canvas
     setStatusFlags(MISSING_SIZE_X | MISSING_SIZE_Y);
   }
 
+  //----------------------------------------------------------------------------
+  Canvas::~Canvas()
+  {
+
+  }
+
   //----------------------------------------------------------------------------
   void Canvas::onDestroy()
   {
index 0173d8ebacfa583cb9682552c444d8c8b28ae9c1..6857d61ddb9485fd5bf3ec6966d9248ec3807f12 100644 (file)
@@ -71,6 +71,7 @@ namespace canvas
       typedef osg::ref_ptr<CullCallback> CullCallbackPtr;
 
       Canvas(SGPropertyNode* node);
+      virtual ~Canvas();
       virtual void onDestroy();
 
       void setSystemAdapter(const SystemAdapterPtr& system_adapter);
index 4091da9fa715c60b57681c218122e8981b183813..7d868d37e473aa4777530690133e63e1bc1c5844 100644 (file)
@@ -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);
   }
 
   //----------------------------------------------------------------------------