# Initialise the ORB
self.orb=CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
# Initialise the Naming Service
- self.initNS(args)
+ self.initNS(args or {})
# --------------------------------------------------------------------------
self.PID=None
self.CMD=[]
self.ARGS=[]
- if self.args['xterm']:
+ if self.args.get('xterm'):
self.ARGS=['xterm', '-iconic', '-sb', '-sl', '500', '-hold']
def __init__(self,args):
def run(self):
global process_id
myargs=self.ARGS
- if self.args['xterm']:
+ if self.args.get('xterm'):
# (Debian) send LD_LIBRARY_PATH to children shells (xterm)
env_ld_library_path=['env', 'LD_LIBRARY_PATH='
+ os.getenv("LD_LIBRARY_PATH")]
if (binding->binding_type == CosNaming::ncontext)
{
- dirList.push_back(CORBA::string_dup(bindingName[0].id));
+ dirList.push_back((const char*)bindingName[0].id);
}
}
NSTEST_echo_i * anEcho = new NSTEST_echo_i(_num);
_num++;
NSTEST::echo_var anEchoRef = anEcho->_this();
+ anEcho->_remove_ref();
return anEchoRef._retn();
}
_myFactoryId = _root_poa->activate_object(_myFactory);
_factoryRef = _myFactory->_this();
_pman->activate();
+ _myFactory->_remove_ref();
}
char *root = NS.getIORaddr();
CORBA::Object_var obj = _orb->string_to_object(root);
+ delete [] root;
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
CosNaming::NamingContext_var rootContext =
char *root = NS.getIORaddr();
CORBA::Object_var obj = _orb->string_to_object(root);
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
+ delete [] root;
CosNaming::NamingContext_var rootContext =
CosNaming::NamingContext::_narrow(obj);
CPPUNIT_ASSERT(ret);
_NS.Change_Directory(path.c_str());
- string curdir = _NS.Current_Directory();
+ char* acurdir = _NS.Current_Directory();
+ string curdir = acurdir;
+ free(acurdir);
CPPUNIT_ASSERT(curdir == path);
}
{
char *root = _NS.getIORaddr();
CORBA::Object_var obj = _orb->string_to_object(root);
+ delete [] root;
CPPUNIT_ASSERT(!CORBA::is_nil(obj));
}
# execute Unit Test
command = ['TestNamingService']
+valgrind = ['valgrind','--leak-check=full']
+#command=valgrind+command #to check memory leaks
ret = os.spawnvp(os.P_WAIT, command[0], command)
# kill Test process
// ready to accept requests.
PortableServer::ObjectId_var myStudyManager_iid = poa->activate_object(myStudyManager_i);
myStudyManager_i->register_name("/myStudyManager");
+ myStudyManager_i->_remove_ref();
// Obtain a POAManager, and tell the POA to start accepting
// requests on its objects.
{
private:
- CORBA::ORB_ptr _orb;
+ CORBA::ORB_var _orb;
PortableServer::POA_var _poa;
SALOMEDSImpl_StudyManager* _impl;
SALOME_NamingService* _name_service;
int ret = pthread_join(*_threadId, NULL);
if (ret) cerr << "error close FileTraceCollector : "<< ret << endl;
else DEVTRACE("FileTraceCollector destruction OK");
+ delete _threadId;
_threadId = 0;
_threadToClose = 0;
}
int ret = pthread_join(*_threadId, NULL);
if (ret) cerr << "error close SALOMETraceCollector : "<< ret << endl;
else DEVTRACE("SALOMETraceCollector destruction OK");
+ delete _threadId;
_threadId = 0;
_threadToClose = 0;
}