From 904e55d657a918d5c179f9e64ba083990ef1d860 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 15 Mar 2020 15:05:20 +0000 Subject: [PATCH] src/MultiPlayer/multiplaymgr.cxx: use SGPropertyNode_ptr to avoid explicit delete. As suggested by James Turner --- src/MultiPlayer/multiplaymgr.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/MultiPlayer/multiplaymgr.cxx b/src/MultiPlayer/multiplaymgr.cxx index 10ad9bdbf..56cb1d67d 100644 --- a/src/MultiPlayer/multiplaymgr.cxx +++ b/src/MultiPlayer/multiplaymgr.cxx @@ -2381,7 +2381,7 @@ FGMultiplayMgr::addMultiplayer(const std::string& callsign, */ mp->_getProps()->removeChildren("set"); - SGPropertyNode* set = NULL; + SGPropertyNode_ptr set; if (simgear::strutils::ends_with(modelName, ".xml") && simgear::strutils::starts_with(modelName, "Aircraft/")) { @@ -2444,8 +2444,7 @@ FGMultiplayMgr::addMultiplayer(const std::string& callsign, break; } } - delete set; - set = NULL; + set.reset(); } } }