From: Anthony Geay Date: Thu, 22 Oct 2015 08:38:12 +0000 (+0200) Subject: Correct bug in case of agressive producer/consumer config. X-Git-Tag: V8_0_pre~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8146c533bb26ecd6be3d0a3ec8ac33d94066e286;p=modules%2Fkernel.git Correct bug in case of agressive producer/consumer config. --- diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx index 0775efc7d..76a78c8ee 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx @@ -385,15 +385,19 @@ void DataScopeServerBase::moveStatusOfVarFromRdExtInitToRdExt(const std::string& { std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > >::iterator it(retrieveVarInternal4(varName)); std::pair< SALOME::BasicDataServer_var, BasicDataServer * >& p(*it); - PickelizedPyObjRdExtInitServer *varc(dynamic_cast(p.second)); - if(!varc) + PickelizedPyObjRdExtInitServer *varc0(dynamic_cast(p.second)); + PickelizedPyObjRdExtServer *varc1(dynamic_cast(p.second)); + if(!varc0 && !varc1) throw Exception("DataScopeServerBase::moveStatusOfVarFromRdExtInitToRdExt : var is not a RdExtInit !"); - PyObject *pyobj(varc->getPyObj()); Py_XINCREF(pyobj); - PickelizedPyObjRdExtServer *newVar(new PickelizedPyObjRdExtServer(this,varName,pyobj)); - CORBA::Object_var obj(newVar->activate()); - SALOME::BasicDataServer_var obj2(SALOME::BasicDataServer::_narrow(obj)); - p.first=obj2; p.second=newVar; - varc->decrRef(); + if(varc0) + { + PyObject *pyobj(varc0->getPyObj()); Py_XINCREF(pyobj); + PickelizedPyObjRdExtServer *newVar(new PickelizedPyObjRdExtServer(this,varName,pyobj)); + CORBA::Object_var obj(newVar->activate()); + SALOME::BasicDataServer_var obj2(SALOME::BasicDataServer::_narrow(obj)); + p.first=obj2; p.second=newVar; + varc0->decrRef(); + } } std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > >::const_iterator DataScopeServerBase::retrieveVarInternal3(const std::string& varName) const