[Kst] [Bug 135440] Crash when a plugin is missing

Adam Treat treat at kde.org
Mon Oct 16 23:12:29 CEST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=135440         
treat kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From treat kde org  2006-10-16 23:12 -------
SVN commit 596190 by treat:

* Fix problem with plugin loading where they don't
become valid until after the data is loaded.

BUGS: 135440


 M  +3 -0      kstdataobject.cpp  
 M  +1 -0      kstdataobject.h  
 M  +11 -4     kstplugin.cpp  


--- trunk/extragear/graphics/kst/src/libkstmath/kstdataobject.cpp #596189:596190
 @ -36,12 +36,14  @
 KstDataObject::KstDataObject() : KstObject() {
   //kstdDebug() << "+++ CREATING DATA OBJECT: " << (void*)this << endl;
   _curveHints = new KstCurveHintList;
+  _isInputLoaded = false;
 }
 
 KstDataObject::KstDataObject(const QDomElement& e) : KstObject() {
   Q_UNUSED(e)
   //kstdDebug() << "+++ CREATING DATA OBJECT: " << (void*)this << endl;
   _curveHints = new KstCurveHintList;
+  _isInputLoaded = false;
 }
 
 
 @ -159,6 +161,7  @
   
   setDirty();
 
+  _isInputLoaded = true;
   return rc;
 }
 
--- trunk/extragear/graphics/kst/src/libkstmath/kstdataobject.h #596189:596190
 @ -112,6 +112,7  @
 
     QString _typeString, _type;
 
+    bool _isInputLoaded;
     QValueList<QPair<QString,QString> > _inputVectorLoadQueue;
     QValueList<QPair<QString,QString> > _inputScalarLoadQueue;
     QValueList<QPair<QString,QString> > _inputStringLoadQueue;
--- trunk/extragear/graphics/kst/src/libkstmath/kstplugin.cpp #596189:596190
 @ -505,10 +505,17  @
 
 
 bool KstPlugin::isValid() const {
-  return _inputVectors.count() == _inArrayCnt &&
-         _inputScalars.count() == _inScalarCnt - _inPid &&
-         _inputStrings.count() == _inStringCnt &&
-         _plugin.data() != 0L;
+  if (_isInputLoaded) {
+    return _inputVectors.count() == _inArrayCnt &&
+           _inputScalars.count() == _inScalarCnt - _inPid &&
+           _inputStrings.count() == _inStringCnt &&
+           _plugin.data() != 0L;
+  } else {
+    return _inputVectorLoadQueue.count() == _inArrayCnt &&
+           _inputScalarLoadQueue.count() == _inScalarCnt - _inPid &&
+           _inputStringLoadQueue.count() == _inStringCnt &&
+           _plugin.data() != 0L;
+  }
 }


More information about the Kst mailing list