21948: EDF SMESH : Memory is not freed when deleting a mesh

Elimenate memory leaks on CORBA objects, servants of SALOMEDS objects etc
This commit is contained in:
eap 2012-12-14 14:06:12 +00:00
parent 413bba9e87
commit 64ed2f3e93
2 changed files with 68 additions and 68 deletions

View File

@ -554,9 +554,10 @@ QString GEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* t
getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj); getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj);
QString anEntry; QString anEntry;
if ( !aSO->_is_nil() ) if ( !aSO->_is_nil() ) {
anEntry = aSO->GetID(); CORBA::String_var entry = aSO->GetID();
anEntry = entry.in();
}
// Each dialog is responsible for this method implementation, // Each dialog is responsible for this method implementation,
// default implementation does nothing // default implementation does nothing
restoreSubShapes(aStudyDS, aSO); restoreSubShapes(aStudyDS, aSO);
@ -770,7 +771,6 @@ bool GEOMBase_Helper::commitCommand( const char* )
//================================================================ //================================================================
bool GEOMBase_Helper::hasCommand() const bool GEOMBase_Helper::hasCommand() const
{ {
bool res = (bool) myCommand;
return (bool)myCommand; return (bool)myCommand;
} }

View File

@ -206,7 +206,7 @@ char* GEOM_Object_i::GetName()
char* aName = _impl->GetName(); char* aName = _impl->GetName();
if (aName) if (aName)
return aName; // this is already copy of pointer (see implementation of _impl) return aName; // this is already copy of pointer (see implementation of _impl)
return strdup(""); return CORBA::string_dup("");
} }
//============================================================================= //=============================================================================