#include <wx/utils.h>
#include <creaImageIOSystem.h>
-
+#include <creaImageIOGimmick.h>
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
namespace creaImageIO
{
// std::cout << "#### MultiThreadImageReader::MultiThreadImageReader("
// << " #threads= " << number_of_threads <<" )"<<std::endl;
+ mDone = false;
// Create the threads
for (int i=0; i<number_of_threads; i++)
{
// std::cout << "#### MultiThreadImageReader::Stop()"
// <<std::endl;
// std::cout << "Sending stop order to the threads..."<<std::endl;
+ if (mDone) return;
ThreadedImageReaderListType::iterator i;
for (i =mThreadedImageReaderList.begin();
{ std::cout << " ===> Thread "<<(*i)->GetCurrentId()
<<" successfully stopped"<< std::endl;
if((*i)->IsAlive())
- {
+ {(*i)->Pause();
(*i).reset();
- //(*i)->Delete();
+ // (*i)->Delete();
}
}
- // mThreadedImageReaderList.clear();
+ mThreadedImageReaderList.clear();
// Wait a little to be sure that all threads have stopped
// A better way to do this ?
// wxMilliSleep(1000);
delete j->first;
}
mImages.clear();
+ mDone = true;
}
//=====================================================================