[Kst] branches/kst/hfi_calib/kst/kst

George Staikos staikos at kde.org
Wed Mar 1 22:27:19 CET 2006


SVN commit 514908 by staikos:

remove unnecessary lock to fix deadlock


 M  +3 -5      ksthsdialog_i.cpp  


--- branches/kst/hfi_calib/kst/kst/ksthsdialog_i.cpp #514907:514908
@@ -210,15 +210,14 @@
   KstHistogramPtr hs;
 
   KST::vectorList.lock().readLock();
-  KstVectorList::Iterator i = KST::vectorList.findTag(_w->_vector->selectedVector());
+  KstVectorPtr vp = *KST::vectorList.findTag(_w->_vector->selectedVector());
   KST::vectorList.lock().readUnlock();
-  if (i == KST::vectorList.end()) {
+  if (!vp) {
     kstdFatal() << "Bug in kst: the Vector field in plotDialog (Hs) refers to "
                 << " a non existant vector..." << endl;
   }
 
-  (*i)->readLock();
-  hs = new KstHistogram(tag_name, *i, new_min, new_max,
+  hs = new KstHistogram(tag_name, vp, new_min, new_max,
                         new_n_bins, new_norm_mode);
   hs->setRealTimeAutoBin(_w->_realTimeAutoBin->isChecked());
 
@@ -270,7 +269,6 @@
       }
     }
   }
-  (*i)->readUnlock();
 
   KST::dataObjectList.lock().writeLock();
   KST::dataObjectList.append(hs.data());


More information about the Kst mailing list