]> git.mxchange.org Git - flightgear.git/commitdiff
Keep ref_ptr in FGNasalModelData (should fix #1234)
authorThomas Geymayer <tomgey@gmail.com>
Fri, 1 Nov 2013 19:52:55 +0000 (20:52 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Fri, 1 Nov 2013 19:52:55 +0000 (20:52 +0100)
src/Scripting/NasalModelData.cxx
src/Scripting/NasalModelData.hxx

index 4d0bda95cb55ddf17087d00c85427b840613e17e..15bbf37ee723d4f2dfec1abb89b675407dab39d3 100644 (file)
@@ -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();
 }
 
 //------------------------------------------------------------------------------
index 22ae536fe7820e957e759cb3936e58cf65b3b6e5..dbe59b76132207d276039c0d7b39cee46a033645 100644 (file)
@@ -67,7 +67,7 @@ private:
     std::string _module, _path;
     SGPropertyNode_ptr _root, _prop;
     SGConstPropertyNode_ptr _load, _unload;
-    osg::Node *_branch;
+    osg::ref_ptr<osg::Node> _branch;
     unsigned int _module_id;
 };