Salome HOME
Merge branch 'V8_5_BR'
[modules/kernel.git] / src / SALOMESDS / SALOMESDS_AutoRefCountPtr.hxx
index e56aba80fe8d5b2c45b9bf0fe95379e345b9fb2d..cdbc5a75bd5c62c7b2bafc93d2e542d4da9a9dc7 100644 (file)
@@ -34,11 +34,19 @@ namespace SALOMESDS
     CORBA::Object_var activate()
     {
       PortableServer::POA_var poa(getPOA());
-      PortableServer::ObjectId_var id(poa->activate_object(this));
+      PortableServer::ObjectId_var id;
+      try
+      {
+          id=poa->activate_object(this);
+      }
+      catch(PortableServer::POA::ServantAlreadyActive& e)
+      {
+          id=poa->servant_to_id(this);
+      }
       CORBA::Object_var ret(poa->id_to_reference(id));
       return ret;
     }
-    
+
     void enforcedRelease()
     {
       PortableServer::POA_var poa(getPOA());
@@ -112,6 +120,7 @@ namespace SALOMESDS
     const T& operator*() const { return *_ptr; }
     operator T *() { return _ptr; }
     operator const T *() const { return _ptr; }
+    bool isNull() const { return _ptr==NULL; }
   private:
     void destroyPtr()
     {