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:
@@ -74,6 +74,12 @@ namespace canvas
|
||||
setStatusFlags(MISSING_SIZE_X | MISSING_SIZE_Y);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
Canvas::~Canvas()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void Canvas::onDestroy()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user