[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Wed Oct 5 21:08:20 CEST 2005
SVN commit 467619 by staikos:
fix my previous commit: the deep copy was resulting in extra refs
M +12 -7 kstdoc.cpp
--- trunk/extragear/graphics/kst/kst/kstdoc.cpp #467618:467619
@@ -859,17 +859,14 @@
KstApp *app = KstApp::inst();
while (again) {
+ KST::dataObjectList.lock().readLock();
+ KST::matrixList.lock().readLock();
KST::vectorList.lock().readLock();
- KstVectorList vectorList = QDeepCopy<KstVectorList>(KST::vectorList);
+ int cnt = KST::matrixList.count() + KST::vectorList.count() + KST::dataObjectList.count();
KST::vectorList.lock().readUnlock();
- KST::matrixList.lock().readLock();
- KstMatrixList matrixList = QDeepCopy<KstMatrixList>(KST::matrixList);
KST::matrixList.lock().readUnlock();
+ KST::dataObjectList.lock().readUnlock();
- KST::dataObjectList.lock().writeLock();
- int cnt = matrixList.count() + vectorList.count() + KST::dataObjectList.count();
- KST::dataObjectList.lock().writeUnlock();
-
int prg = 0;
app->slotUpdateProgress(cnt, prg, purging);
again = false;
@@ -891,6 +888,10 @@
}
KST::dataObjectList.lock().writeUnlock();
+ KST::vectorList.lock().readLock();
+ KstVectorList vectorList = QDeepCopy<KstVectorList>(KST::vectorList);
+ KST::vectorList.lock().readUnlock();
+
// clear unused vectors that are editable
for (KstVectorList::ConstIterator it = vectorList.begin(); it != vectorList.end(); ++it) {
//kdDebug() << "VECTOR: " << (*it)->tagName() << " USAGE: " << (*it)->getUsage() << endl;
@@ -906,6 +907,10 @@
app->slotUpdateProgress(cnt, prg, purging);
}
+ KST::matrixList.lock().readLock();
+ KstMatrixList matrixList = QDeepCopy<KstMatrixList>(KST::matrixList);
+ KST::matrixList.lock().readUnlock();
+
// clear unused matrices that are editable
for (KstMatrixList::ConstIterator it = matrixList.begin(); it != matrixList.end(); ++it) {
if ((*it)->getUsage() == 1) {
More information about the Kst
mailing list