]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOMultiThreadImageReader.cpp
clean-up
[creaImageIO.git] / src2 / creaImageIOMultiThreadImageReader.cpp
index 7dae59112f77e1726d0ead210863a8936f6a403a..5871d8044774da930d67e3d9d033d8cb75bdd175 100644 (file)
@@ -48,7 +48,6 @@ namespace creaImageIO
        
   };
 
   //=====================================================================
 
   
@@ -69,7 +68,7 @@ namespace creaImageIO
                  boost::shared_ptr<ThreadedImageReader> t(new ThreadedImageReader(this), ThreadedImageReader::deleter());
        mThreadedImageReaderList.push_back(t);
         std::cout << "  ===> Thread "<<i
-                             <<" successfully added"<< std::endl;
+                     <<" successfully added"<< std::endl;
       }
     mNumberOfThreadedReadersRunning = 0;
     // Init the queue
@@ -134,6 +133,7 @@ namespace creaImageIO
                              <<" successfully stopped"<< std::endl;
                  if((*i)->IsAlive())
                  {
+                         (*i).reset();
                         //(*i)->Delete();
                  }
       }
@@ -212,7 +212,7 @@ namespace creaImageIO
                                        int priority )
   {
        wxMutexLocker lock(GetMultiThreadImageReaderUserMutex()); //mMutex);
-    
+
          if (mNumberOfThreadedReadersRunning==0)
 //    if (mThreadedImageReaderList.size()==0) 
       {
@@ -241,7 +241,6 @@ namespace creaImageIO
        return;
       }
 
-
     ImageToLoad itl(user,filename);
     ImageMapType::iterator i = mImages.find(&itl);
     if (i!=mImages.end())
@@ -482,7 +481,6 @@ namespace creaImageIO
 
        GimmickMessage(5," ==> Total mem = "<<mTotalMem<<" Ko "<<std::endl);
 
-
        if (user!=0) 
          {
            //      std::cout << "unlock..."<<std::endl;
@@ -493,7 +491,6 @@ namespace creaImageIO
               MultiThreadImageReaderUser::ImageUnloaded,
               0);
            //      std::cout << "event ok"<<std::endl;
-
          }     
 
        if (unload->Index()>=0)
@@ -513,8 +510,6 @@ namespace creaImageIO
        //          std::cout << "delete ok."<<std::endl;
 
       }
-    
-  
   }
   //=====================================================================