[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Fri Oct 22 01:15:18 CEST 2004


CVS commit by staikos: 

fix reference counting bugs in main()


  M +13 -17    main.cpp   1.85


--- kdeextragear-2/kst/kst/main.cpp  #1.84:1.85
@@ -336,12 +336,4 @@ int main(int argc, char *argv[]) {
     /* temp variables: these all get stuck into list objects */
     KstDataSourcePtr file;
-    KstRVectorPtr xvector;
-    KstRVectorPtr yvector;
-    KstRVectorPtr evector;
-    KstVCurvePtr curve;
-    KstPSDPtr psd;
-    KstEquationPtr eq;
-    KstHistogramPtr hs;
-    Kst2DPlotPtr plot;
 
     int n_y, n_eq=0;
@@ -388,5 +380,5 @@ int main(int argc, char *argv[]) {
 
       i_plot = 0;
-      plot = *plist.at(i_plot);
+      Kst2DPlotPtr plot = *plist.at(i_plot);
 
       /* make stand alone equations if there are no files */
@@ -402,8 +394,5 @@ int main(int argc, char *argv[]) {
               eqS = *eq_i;
               if (NoVectorEq(eqS)) {
-                eq = new KstEquation(QString("E")+QString::number(n_eq+1)+
-                                       "-" + eqS,
-                                       eqS,
-                                       min, max, n);
+                KstEquationPtr eq = new KstEquation(QString("E") +QString::number(n_eq+1)+ "-" + eqS, eqS, min, max, n);
                 KstVCurvePtr vc = new KstVCurve(eq->tagName() + "-curve", eq->vX(), eq->vY(), 0L, 0L, KstColorSequence::next(plot->Curves,plot->backgroundColor()));
 
@@ -447,4 +436,10 @@ int main(int argc, char *argv[]) {
         KST::dataObjectList.lock().writeUnlock();
 
+        KstRVectorPtr yvector;
+        KstRVectorPtr evector;
+        KstVCurvePtr curve;
+        KstPSDPtr psd;
+        KstHistogramPtr hs;
+        KstRVectorPtr xvector;
         if (!ycolList.isEmpty()) { // if there are some xy plots
           /* make the x axis vector */
@@ -494,4 +489,5 @@ int main(int argc, char *argv[]) {
             eqS = *eq_i;
             ProcessEq(eqS, file, in, &eq_ok);
+            KstEquationPtr eq;
             if (xeq) {
               eq = new KstEquation(QString("E")+QString::number(n_eq+1)+





More information about the Kst mailing list