From ba2e210e022e0beeffbfb56463211a1363e8c841 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 20 Dec 2017 19:58:48 +0300 Subject: [PATCH] Memory leaks --- src/GEOMGUI/GEOM_Displayer.cxx | 3 ++- src/GEOM_I/GEOM_Gen_i.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/GEOMGUI/GEOM_Displayer.cxx b/src/GEOMGUI/GEOM_Displayer.cxx index 3503704e3..c08cee809 100755 --- a/src/GEOMGUI/GEOM_Displayer.cxx +++ b/src/GEOMGUI/GEOM_Displayer.cxx @@ -1790,7 +1790,8 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry, if ( !GeomObject->_is_nil() ) { - theIO->setName( GeomObject->GetName() ); + CORBA::String_var name = GeomObject->GetName(); + theIO->setName( name ); // finally set shape setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) ); } diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 7ccc970dd..e487554d5 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -159,7 +159,7 @@ char* GEOM_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, GEOM::GEOM_BaseObject_var anObject = GEOM::GEOM_BaseObject::_narrow(_orb->string_to_object(IORString)); if (!CORBA::is_nil(anObject)) { - return CORBA::string_dup(anObject->GetEntry()); + return anObject->GetEntry(); } return 0; } -- 2.39.2