From: mfranz Date: Thu, 30 Jun 2005 18:34:20 +0000 (+0000) Subject: - replace one SGPropertyNode* by SGPropertyNode_ptr to avoid crash with X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9f0397a7208ab4f6e1308447a38495efd3f3db8f;p=flightgear.git - replace one SGPropertyNode* by SGPropertyNode_ptr to avoid crash with temporary removeChild(); should be done even after reverting; the node is accessed after removal - cleanup: if (foo) delete foo --> delete foo --- diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index d66de0300..e71b2346f 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -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; } diff --git a/src/AIModel/AIBase.hxx b/src/AIModel/AIBase.hxx index 14467a236..f24ebd86a 100644 --- a/src/AIModel/AIBase.hxx +++ b/src/AIModel/AIBase.hxx @@ -119,7 +119,7 @@ public: protected: - SGPropertyNode *props; + SGPropertyNode_ptr props; FGAIManager* manager; // these describe the model's actual state