[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Jan 5 06:31:11 CET 2005


CVS commit by staikos: 

Fix most of the dirfile crash problems, but not all of it.  It crashes on exit
now.

CCBUG: 96039


  M +32 -0     d2asc.cpp   1.18


--- kdeextragear-2/kst/kst/d2asc.cpp  #1.17:1.18
@@ -1,7 +1,28 @@
+/***************************************************************************
+                                d2asc.cpp
+                             -------------------
+    begin                : Tue Aug 22 13:46:13 CST 2000
+    copyright            : (C) 2000 by Barth Netterfield
+    email                :
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
 #include <stdlib.h> // atoi
+#include <kconfig.h>
 #include <kinstance.h>
 
+// hack to make main() a friend of kstdatasource
+#define protected public
 #include "kstrvector.h"
 #include "kstdatacollection.h"
+#undef protected
 
 void Usage() {
@@ -12,9 +33,20 @@ void Usage() {
 }
 
+
+static void exitHelper() {
+  KST::vectorList.clear();
+  KST::scalarList.clear();
+  KST::dataObjectList.clear();
+}
+
 int main(int argc, char *argv[]) {
+  atexit(exitHelper);
   KInstance inst("d2asc");
   KstDataSourcePtr file;
   int i;
 
+  KConfig *kConfigObject = new KConfig("kstdatarc", false, false);
+  KstDataSource::setupOnStartup(kConfigObject);
+
   char field_list[40][120], filename[180];
   bool do_hex[40];




More information about the Kst mailing list