From 2aa2424395203de8313ea75ea3e5d37d4d0ff757 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 14 Dec 2012 12:16:09 +0000 Subject: [PATCH] 21948: EDF SMESH : Memory is not freed when deleting a mesh Add debug code printing object type and myRefCounter --- src/GenericObj/SALOME_GenericObj_i.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/GenericObj/SALOME_GenericObj_i.cc b/src/GenericObj/SALOME_GenericObj_i.cc index bdb830cc7..03a790c2a 100644 --- a/src/GenericObj/SALOME_GenericObj_i.cc +++ b/src/GenericObj/SALOME_GenericObj_i.cc @@ -26,14 +26,33 @@ #include "SALOME_GenericObj_i.hh" #include "utilities.h" +#include +#include + +// note: in KERNEL _DEBUG_ is not defined by default #ifdef _DEBUG_ static int MYDEBUG = 0; #else static int MYDEBUG = 0; #endif +//#define IS_OBJ_IN_QUESTION(where) is_obj_in_question(this, myRefCounter, where) +#define IS_OBJ_IN_QUESTION(where) + namespace SALOME { + void is_obj_in_question( const GenericObj_i* o, int myRefCounter,const char* where) + { + if ( std::string( typeid(*o).name() ).find("SALOMEDS") != std::string::npos ) + return; + // if ( std::string( typeid(*o).name() ).find("SMESH_") != std::string::npos || + // std::string( typeid(*o).name() ).find("StdMesher") != std::string::npos ) + { + std::cout<< typeid(*o).name() << " " << o << " " << where << " myRefCounter ==> " << myRefCounter; + if ( myRefCounter == 0 ) std::cout << " DELETE !"; + std::cout << std::endl; + } + } /*! \class SALOME::GenericObj_i @@ -96,6 +115,7 @@ namespace SALOME if(MYDEBUG) MESSAGE("GenericObj_i::Register "<servant_to_id(this); myPOA->deactivate_object(anObjectId.in()); _remove_ref(); -- 2.39.2