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.
This commit is contained in:
Thomas Geymayer
2013-12-07 13:40:22 +01:00
parent b7662f16e5
commit 2c3f44ae11
3 changed files with 9 additions and 2 deletions

View File

@@ -74,6 +74,12 @@ namespace canvas
setStatusFlags(MISSING_SIZE_X | MISSING_SIZE_Y);
}
//----------------------------------------------------------------------------
Canvas::~Canvas()
{
}
//----------------------------------------------------------------------------
void Canvas::onDestroy()
{

View 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);

View 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);
}
//----------------------------------------------------------------------------