Bug 135232 - Crash on editing equation with non-existent vectors
Summary: Crash on editing equation with non-existent vectors
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-07 01:19 UTC by Adam Treat
Modified: 2006-10-07 01:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Treat 2006-10-07 01:19:07 UTC
Version:           trunk and 1.3 (using KDE Devel)
Installed from:    Compiled sources

When editing an equation and changing a vector reference from an existing vector to a non-existing vector kst crashes.  The fix is similar to 593166 and is forthcoming.
Comment 1 Adam Treat 2006-10-07 01:42:29 UTC
SVN commit 593176 by treat:

* This bug was really another instance of the others...
I can't make the equation editor crash now.

BUG: 135232


 M  +4 -2      kstequation.cpp  


--- trunk/extragear/graphics/kst/src/libkstmath/kstequation.cpp #593175:593176
@@ -25,7 +25,6 @@
 
 // include files for Qt
 #include <qstylesheet.h>
-#include <qdeepcopy.h>
 
 // include files for KDE
 #include <klocale.h>
@@ -268,6 +267,7 @@
   // document loading with vector lazy-loading
   setDirty();
   _equation = in_fn;
+
   VectorsUsed.clear();
 
   KstScalarMap::Iterator it = _inputScalars.begin();
@@ -293,7 +293,9 @@
       Equation::FoldVisitor vis(&ctx, &_pe);
       KstStringMap sm;
 
-      if (_pe->collectObjects(VectorsUsed, _inputScalars, sm)) {
+      KstScalarMap tmp = _inputScalars;
+      if (_pe->collectObjects(VectorsUsed, tmp, sm)) {
+        _inputScalars = tmp;
         if (lockData) {
           KstScalarMap::Iterator it = _inputScalars.begin();
           for (; it != _inputScalars.end(); ++it) {