]> git.mxchange.org Git - flightgear.git/commitdiff
- replace one SGPropertyNode* by SGPropertyNode_ptr to avoid crash with
authormfranz <mfranz>
Thu, 30 Jun 2005 18:34:20 +0000 (18:34 +0000)
committermfranz <mfranz>
Thu, 30 Jun 2005 18:34:20 +0000 (18:34 +0000)
  temporary removeChild(); should be done even after reverting; the node
  is accessed after removal
- cleanup:  if (foo) delete foo  -->  delete foo

src/AIModel/AIBase.cxx
src/AIModel/AIBase.hxx

index d66de0300d9ef08bec26c5719f66012ea7496798..e71b2346f03c7fafc52c6787e87e3611d1ab14b1 100644 (file)
@@ -76,7 +76,7 @@ FGAIBase::~FGAIBase() {
     // unbind();
     SGPropertyNode *root = globals->get_props()->getNode("ai/models", true);
     root->removeChild(_type_str.c_str(), index);
-    if (fp) delete fp;
+    delete fp;
     fp = NULL;
 }
 
index 14467a2366066af68bb26a26df87867e0a9f5305..f24ebd86a556a8dba8934808b6cc79ef3ce63ebd 100644 (file)
@@ -119,7 +119,7 @@ public:
 
 protected:
 
-    SGPropertyNode *props;
+    SGPropertyNode_ptr props;
     FGAIManager* manager;
 
     // these describe the model's actual state