SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB, SALOME_NamingService_Abstract *ns);
+ SALOME_NamingService_Abstract *getNS() const { return _name_service; }
+
virtual ~SALOMEDS_DriverFactory_i();
virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType);
#include "Basics_Utils.hxx"
#include "SALOME_KernelServices.hxx"
+#include "SALOME_Fake_NamingService.hxx"
+
+#include <memory>
#ifdef WIN32
#include <process.h>
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
_poa = PortableServer::POA::_duplicate(poa);
- SALOMEDS_Study_i *servant = new SALOMEDS_Study_i(orb,SALOME::Session::_nil());
+ SALOME_Fake_NamingService ns;
+ SALOMEDS_Study_i *servant = new SALOMEDS_Study_i(orb,&ns);
_study = servant->_this();
}
return SALOMEDS::Study::_duplicate(_study);
throw SALOMEDS::Study::StudyInvalidReference();
std::string aPath((char*)thePath), aBaseName((char*)theBaseName);
- SALOMEDS_DriverFactory_i* factory = new SALOMEDS_DriverFactory_i(_orb);
- bool ret = _impl->DumpStudy(aPath, aBaseName, isPublished, isMultiFile, factory);
- delete factory;
-
+ bool ret = false;
+ {
+ std::unique_ptr<SALOMEDS_DriverFactory_i> factory( new SALOMEDS_DriverFactory_i(_orb,_factory->getNS()) );
+ ret = _impl->DumpStudy(aPath, aBaseName, isPublished, isMultiFile, factory.get());
+ }
return ret;
}