*/
QString SALOME_PYQT_Module::engineIOR() const
{
+ QString anIOR = QString::null;
if ( !CORBA::is_nil( getEngine() ) )
- return QString( getApp()->orb()->object_to_string( getEngine() ) );
- return QString( "" );
+ {
+ CORBA::String_var objStr = getApp()->orb()->object_to_string( getEngine() );
+ anIOR = QString( objStr.in() );
+ }
+ return anIOR;
}
/*!
QString anIOR( "" );
CORBA::Object_ptr anEngine = namingService()->Resolve( "/SalomeAppEngine" );
if ( !CORBA::is_nil( anEngine ) )
- anIOR = orb()->object_to_string( anEngine );
+ {
+ CORBA::String_var objStr = orb()->object_to_string( anEngine );
+ anIOR = QString( objStr.in() );
+ }
return anIOR;
}
{
for (int i=0; i<argc-1; i++)
//argv[i+1] = _argCopy[(*itServ)._firstArg + i].c_str();
- argv[i+1] = _argv[(*itServ)._firstArg + i];
+ argv[i+1] = _argv[(*itServ)._firstArg + i];
}
std::cout << "*** activating [" << argc << "] : " << argv[0] << std::endl;
_serverThreads.push_front(aServerThread);
aServerThread->Init();
+ free( argv[0] );
+ delete[] argv;
}
// Always launch Session Server
Session_SessionThread* aServerThread
= new Session_SessionThread(argc, argv, _orb,_root_poa,_SessionMutex,_SessionStarted);
_serverThreads.push_front(aServerThread);
-
aServerThread->Init();
+ delete[] argv;
}
/*!
{
//MESSAGE("Session_ServerThread Constructor " << argv[0]);
_argc = argc;
- _argv = argv;
+ _argv = new char*[ _argc + 1 ];
+ _argv[_argc] = 0;
+ for (int i = 0; i < _argc; i++ )
+ _argv[i] = strdup( argv[i] );
+
_orb = CORBA::ORB::_duplicate(orb);
_root_poa = PortableServer::POA::_duplicate(poa);
_servType =-1;
Session_ServerThread::~Session_ServerThread()
{
//MESSAGE("~Session_ServerThread "<< _argv[0]);
+ delete _NS;
+ for (int i = 0; i <_argc ; i++ )
+ free( _argv[i] );
+ delete[] _argv;
}
/*!
INFOS("RegistryService servant already existing" );
ASSERT(0);
}
- catch( const ServiceUnreachable &ex )
+ catch( const ServiceUnreachable &/*ex*/ )
{
}
- catch( const CORBA::Exception &exx )
+ catch( const CORBA::Exception &/*exx*/ )
{
}
string absoluteName = string("/") + registryName;
{
INFOS("SalomeApp_Engine thread started");
SalomeApp_Engine_i* anEngine = new SalomeApp_Engine_i();
- /*PortableServer::ObjectId_var id = */_root_poa->activate_object( anEngine );
+ // declare variable and get value for them to avoid compilation warning of unused variable
+ // this variable is necessary to avoid memory leak of memory allocated in corba
+ PortableServer::ObjectId_var id = 0;
+ id = _root_poa->activate_object( anEngine );
+ ///*PortableServer::ObjectId_var id = */_root_poa->activate_object( anEngine );
INFOS("poa->activate_object( SalomeApp_Engine )");
- CORBA::Object_ptr obj = anEngine->_this();
+ CORBA::Object_var obj = anEngine->_this();
_NS->Register( obj ,"/SalomeAppEngine");
}