[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Jun 7 18:34:07 CEST 2004


CVS commit by staikos: 

revert last.  Causes a lengthy list of memory errors, though it looked fine
to me on first glance.


  M +14 -3     kstdoc.cpp   1.83


--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.82:1.83
@@ -466,4 +466,6 @@ bool KstDoc::saveDocument(const QString 
 
 void KstDoc::deleteContents() {
+  KMdiIterator<KMdiChildView*>* pIterator;
+
   KST::vectorDefaults.sync();
 
@@ -473,5 +475,15 @@ void KstDoc::deleteContents() {
 
   if (KstApp::inst()) {
-    KstApp::inst()->closeAllViews();
+    pIterator = KstApp::inst()->createIterator();
+    if (pIterator) {
+      while (pIterator->currentItem()) {
+        KMdiChildView *pView = pIterator->currentItem();
+        pIterator->next();
+        if (pView) {
+          KstApp::inst()->closeWindow(pView);
+        }
+      }
+      KstApp::inst()->deleteIterator(pIterator);
+    }
   }
   
@@ -847,7 +859,6 @@ static bool backupFile(const QString& qF
     ::close( fd );
 
-    if (::close(fd2)) {
+    if (::close(fd2))
         return false;
-    }
     return true;
 }





More information about the Kst mailing list