[Kst] extragear/graphics/kst/src/libkstapp

George Staikos staikos at kde.org
Wed Mar 1 22:26:18 CET 2006


SVN commit 514906 by staikos:

Remove unnecessary and incorrect lock on the input vector to avoid a deadlock
BUG: 122927


 M  +3 -5      ksthsdialog_i.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/ksthsdialog_i.cpp #514905:514906
@@ -211,15 +211,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());
 
@@ -271,7 +270,6 @@
       }
     }
   }
-  (*i)->readUnlock();
 
   KST::dataObjectList.lock().writeLock();
   KST::dataObjectList.append(hs.data());


More information about the Kst mailing list