[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu Mar 18 22:48:36 CET 2004


CVS commit by arwalker: 

Prevented deadlock by moving:
KstWriteLocker wl(&KST::vectorList.lock());
beyond the call to vy = new KstRVector( ... )

The problem was that KstRVector implicitly
performs a write lock on KST::vectorList
in the KstVector constructor. Hence the
deadlock.


  M +47 -44    kstquickcurvesdialog_i.cpp   1.32


--- kdeextragear-2/kst/kst/kstquickcurvesdialog_i.cpp  #1.31:1.32
@@ -242,5 +242,4 @@ bool KstQuickCurvesDialogI::apply(bool a
   }
 
-  KstWriteLocker wl(&KST::vectorList.lock());
   if (y_is_new) {
     /* If not, Generate a unique vector name */
@@ -264,4 +263,6 @@ bool KstQuickCurvesDialogI::apply(bool a
   }
 
+  {
+    KstWriteLocker wl(&KST::vectorList.lock());
   if (x_is_new) {
     if (!vx->isValid()) {
@@ -306,8 +307,10 @@ bool KstQuickCurvesDialogI::apply(bool a
   plot = KST::plotList.FindKstPlot(PlotList->currentText());
   plot->addCurve(curve);
-  if (autolabel)
+    if (autolabel) {
     plot->GenerateDefaultLabels();
-
+    }
   close();
+  }
+  
   emit docChanged();
   update();





More information about the Kst mailing list