From 1bb8d1c4a30a3d33dc170d781fcbf12198315b08 Mon Sep 17 00:00:00 2001 From: rnv Date: Tue, 12 Oct 2010 08:04:44 +0000 Subject: [PATCH] Fix of the bugs: 1) IPAL22049 TC5.1.5: Application crash at close document operation 2) Bug IPAL22067 TC5.1.5: SIGSEGV exception at close application after MESH-002 scenario execution Avoid double deletion of the Salome Generic Objects: 1. First decrement of the reference count in the SALOMEDSImpl_AttributeIOR::~SALOMEDSImpl_AttributeIOR(); 2. Second decrement of the reference count in RemovePostponed(...) method; --- src/SALOMEDS/SALOMEDS_Study_i.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 56be377dc..94e3537e0 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -678,7 +678,7 @@ SALOMEDS::UseCaseBuilder_ptr SALOMEDS_Study_i::GetUseCaseBuilder() void SALOMEDS_Study_i::Close() { SALOMEDS::Locker lock; - + RemovePostponed(-1); SALOMEDS::SComponentIterator_var itcomponent = NewComponentIterator(); @@ -756,7 +756,10 @@ void SALOMEDS_Study_i::RemovePostponed(CORBA::Long /*theUndoLimit*/) try { CORBA::Object_var obj = _orb->string_to_object(anIORs[i].c_str()); SALOME::GenericObj_var aGeneric = SALOME::GenericObj::_narrow(obj); - if (!CORBA::is_nil(aGeneric)) aGeneric->Destroy(); + //rnv: To avoid double deletion of the Salome Generic Objects: + //rnv: 1. First decrement of the reference count in the SALOMEDSImpl_AttributeIOR::~SALOMEDSImpl_AttributeIOR(); + //rnv: 2. Second decrement of the reference count in the next string : aGeneric->Destroy(); + //if (!CORBA::is_nil(aGeneric)) aGeneric->Destroy(); } catch (...) {} } -- 2.39.2