mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +02:00
removed leak from postprocessing, moved delete task to earlier in threadpool and deleting threadpool
This commit is contained in:
parent
0e9cf558b4
commit
15424149cd
@ -293,7 +293,6 @@ multiSlsDetector::~multiSlsDetector() {
|
|||||||
int multiSlsDetector::createThreadPool(){
|
int multiSlsDetector::createThreadPool(){
|
||||||
if(threadpool){
|
if(threadpool){
|
||||||
threadpool->destroy_threadpool();
|
threadpool->destroy_threadpool();
|
||||||
threadpool=0;
|
|
||||||
}
|
}
|
||||||
if(thisMultiDetector->numberOfDetectors < 1){
|
if(thisMultiDetector->numberOfDetectors < 1){
|
||||||
cout << "No detectors attached to create threadpool" << endl;
|
cout << "No detectors attached to create threadpool" << endl;
|
||||||
@ -321,6 +320,7 @@ int multiSlsDetector::createThreadPool(){
|
|||||||
void multiSlsDetector::destroyThreadPool(){
|
void multiSlsDetector::destroyThreadPool(){
|
||||||
if(threadpool){
|
if(threadpool){
|
||||||
threadpool->destroy_threadpool();
|
threadpool->destroy_threadpool();
|
||||||
|
delete threadpool;
|
||||||
threadpool=0;
|
threadpool=0;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout<<"Destroyed Threadpool "<< threadpool << endl;
|
cout<<"Destroyed Threadpool "<< threadpool << endl;
|
||||||
|
@ -778,6 +778,14 @@ void postProcessing::initDataset(int r) {
|
|||||||
cout << "done" << endl;
|
cout << "done" << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
delete [] chPM;
|
||||||
|
delete [] mM;
|
||||||
|
if (ffcoeff != NULL) delete [] ffcoeff;
|
||||||
|
if (fferr != NULL) delete [] fferr;
|
||||||
|
if (angRad != NULL) delete [] angRad;
|
||||||
|
if (angOff != NULL) delete [] angOff;
|
||||||
|
if (angCenter != NULL) delete [] angCenter;
|
||||||
|
|
||||||
|
|
||||||
if (*correctionMask&(1<< ANGULAR_CONVERSION)) {
|
if (*correctionMask&(1<< ANGULAR_CONVERSION)) {
|
||||||
arraySize=getNumberOfAngularBins();
|
arraySize=getNumberOfAngularBins();
|
||||||
|
@ -127,6 +127,9 @@ void* ThreadPool::execute_thread(){
|
|||||||
(*task)(); // could also do task->run(arg);
|
(*task)(); // could also do task->run(arg);
|
||||||
/*cout << ithread <<" Done executing thread " << pthread_self() << endl;*/
|
/*cout << ithread <<" Done executing thread " << pthread_self() << endl;*/
|
||||||
|
|
||||||
|
delete task;
|
||||||
|
/*cout << ithread << " task deleted" << endl;*/
|
||||||
|
|
||||||
m_task_mutex.lock();
|
m_task_mutex.lock();
|
||||||
number_of_ongoing_tasks--;
|
number_of_ongoing_tasks--;
|
||||||
m_task_mutex.unlock();
|
m_task_mutex.unlock();
|
||||||
@ -138,9 +141,10 @@ void* ThreadPool::execute_thread(){
|
|||||||
m_tasks_loaded = false;
|
m_tasks_loaded = false;
|
||||||
}
|
}
|
||||||
//if(zmqthreadpool) cout<<"***"<<ithread<<" semaphore done address post:"<<&semDone<<endl;
|
//if(zmqthreadpool) cout<<"***"<<ithread<<" semaphore done address post:"<<&semDone<<endl;
|
||||||
|
|
||||||
|
|
||||||
sem_post(&semDone);
|
sem_post(&semDone);
|
||||||
delete task;
|
//removed deleteing task to earlier
|
||||||
/*cout << ithread << " task deleted" << endl;*/
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user