From 5b0f44f0dbebd3bb4372ae98ebaaee5f9b3b42f3 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Mon, 24 Aug 2020 00:20:59 -0500 Subject: [PATCH] Memory Leak Fix - matlib Reclaimed 61,560 bytes in 405 blocks --- simgear/scene/material/matlib.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/simgear/scene/material/matlib.cxx b/simgear/scene/material/matlib.cxx index 809fa3ba..d4ee0630 100644 --- a/simgear/scene/material/matlib.cxx +++ b/simgear/scene/material/matlib.cxx @@ -97,8 +97,7 @@ bool SGMaterialLib::load( const SGPath &fg_root, const SGPath& mpath, } // Read list of areas - // REVIEW: Memory Leak - 10,240 (1,440 direct, 8,800 indirect) bytes in 60 blocks are definitely lost - AreaList* arealist = new AreaList; + auto arealist = std::make_shared(); const simgear::PropertyList areas = node->getChildren("area"); simgear::PropertyList::const_iterator area_iter = areas.begin();