From: Thomas Geymayer Date: Fri, 1 Nov 2013 19:52:55 +0000 (+0100) Subject: Keep ref_ptr in FGNasalModelData (should fix #1234) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4c9ab24b6629c979692b33b5459428c5fc2f88b3;p=flightgear.git Keep ref_ptr in FGNasalModelData (should fix #1234) --- diff --git a/src/Scripting/NasalModelData.cxx b/src/Scripting/NasalModelData.cxx index 4d0bda95c..15bbf37ee 100644 --- a/src/Scripting/NasalModelData.cxx +++ b/src/Scripting/NasalModelData.cxx @@ -100,7 +100,7 @@ FGNasalModelData::~FGNasalModelData() ( SG_NASAL, SG_INFO, - "Removed model with script(s) (branch = " << _branch << ")" + "Removed model with script(s) (branch = " << _branch.get() << ")" ); } @@ -127,7 +127,7 @@ void FGNasalModelData::load() .method("getPose", &f_node_getPose); } - module.set("_model", NodeRef(_branch)); + module.set("_model", _branch); naRef arg[2]; arg[0] = nasalSys->propNodeGhost(_root); @@ -163,7 +163,7 @@ void FGNasalModelData::unload() //------------------------------------------------------------------------------ osg::Node* FGNasalModelData::getNode() { - return _branch; + return _branch.get(); } //------------------------------------------------------------------------------ diff --git a/src/Scripting/NasalModelData.hxx b/src/Scripting/NasalModelData.hxx index 22ae536fe..dbe59b761 100644 --- a/src/Scripting/NasalModelData.hxx +++ b/src/Scripting/NasalModelData.hxx @@ -67,7 +67,7 @@ private: std::string _module, _path; SGPropertyNode_ptr _root, _prop; SGConstPropertyNode_ptr _load, _unload; - osg::Node *_branch; + osg::ref_ptr _branch; unsigned int _module_id; };