[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Nov 10 11:59:37 CET 2004


CVS commit by staikos: 

fix locking (from hfi branch)


  M +5 -3      kstrvector.cpp   1.65


--- kdeextragear-2/kst/kst/kstrvector.cpp  #1.64:1.65
@@ -17,4 +17,5 @@
  ***************************************************************************/
 
+#include <assert.h>
 #include <math.h>
 #include <stdlib.h>
@@ -595,12 +596,13 @@ void KstRVector::reload() {
       //
       KstDataSourcePtr newsrc = KstDataSource::loadSource(_file->fileName(), _file->fileType());
-      _file->writeUnlock();
+      assert(newsrc != _file);
       if (newsrc) {
+        _file->writeUnlock();
         KST::dataSourceList.lock().writeLock();
         KST::dataSourceList.remove(_file);
-        KST::dataSourceList.append(newsrc);
-        KST::dataSourceList.lock().writeUnlock();
         _file = newsrc;
         _file->writeLock();
+        KST::dataSourceList.append(_file);
+        KST::dataSourceList.lock().writeUnlock();
         reset();
       }





More information about the Kst mailing list