trying to find memory leak, deleted pointers etc

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@629 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2013-07-10 09:31:29 +00:00
parent e8e2c7b3e4
commit cf30612701
6 changed files with 57 additions and 24 deletions

View File

@ -108,6 +108,18 @@ slsReceiverFunctionList::slsReceiverFunctionList(detectorType det,bool moenchwit
slsReceiverFunctionList::~slsReceiverFunctionList(){
if(latestData) delete [] latestData;
if(fifofree) delete [] fifofree;
if(fifo) delete [] fifo;
if(guiFileName) delete [] guiFileName;
if(eth) delete [] eth;
if(mem0) free(mem0);
}
int slsReceiverFunctionList::setEnableFileWrite(int i){
if(i!=-1)
enableFileWrite=i;
@ -322,6 +334,10 @@ int slsReceiverFunctionList::startListening(){
if (strchr(eth,'.')!=NULL) strcpy(eth,"");
if(!strlen(eth)){
cout<<"warning:eth is empty.listening to all"<<endl;
if(udpSocket){
delete udpSocket;
udpSocket = NULL;
}
udpSocket = new genericSocket(server_port,genericSocket::UDP,bufferSize/packetsPerFrame,packetsPerFrame);
}else{
cout<<"eth:"<<eth<<endl;
@ -390,7 +406,6 @@ int slsReceiverFunctionList::startListening(){
//Close down any open socket descriptors
udpSocket->Disconnect();
#ifdef VERBOSE
cout << "listening_thread_running:" << listening_thread_running << endl;
#endif