From 2d869dc15560446c9dbcbade3c2fe21582346f45 Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 13 Oct 2020 07:50:19 +0300 Subject: [PATCH] 0031844: Coding - memory leak in Standard_MMgrFactory Added missing deletion (previously commented without a hint why). --- src/Standard/Standard.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Standard/Standard.cxx b/src/Standard/Standard.cxx index 78b25e1cb7..bed42994f2 100644 --- a/src/Standard/Standard.cxx +++ b/src/Standard/Standard.cxx @@ -179,8 +179,11 @@ Standard_MMgrFactory::Standard_MMgrFactory() Standard_MMgrFactory::~Standard_MMgrFactory() { - if ( myFMMgr ) + if (myFMMgr != NULL) + { myFMMgr->Purge(Standard_True); + delete myFMMgr; + } } //======================================================================= @@ -208,7 +211,7 @@ Standard_MMgrFactory::~Standard_MMgrFactory() // WNT MSVC++) to put destructing function in code segment that is called // after destructors of other (even static) objects. However, this is not // done by the moment since it is compiler-dependent and there is no guarantee -// thatsome other object calling memory manager is not placed also in that segment... +// that some other object calling memory manager is not placed also in that segment... // // Note that C runtime function atexit() could not help in this problem // since its behaviour is the same as for destructors of static objects -- 2.39.5