[Kst] Potential crash...

George Staikos staikos at kde.org
Thu Feb 10 22:09:57 CET 2005


On Thursday 10 February 2005 16:02, Andrew Walker wrote:
> I could make it crash by trying to load the old demo.kst file.
> It is of course trivial to make it crash by changing the value of
> vectag in the .kst file by hand.
>
> If you call load() later and vectag is not found then it returns false.
> The object is deleted and (obviously) not added to the global data object
> list. There will be no crash.

  Correct, no crash, but also incorrect results and a basically unusable 
session in many cases.  The important fix is to fix all the object 
dependencies, and then I think we need to determine what we want for 
dependency behaviour on loading.  This isn't well defined yet, so changing 
the code just moves from one broken state to another.

  My view on this is that objects should continue to exist but become valid() 
== false and hierarchically are pulled out of the tree (with some sort of 
invalid icon in the data manager) until they are usable again.  They become 
usable when their dependencies come into existence.  If this is the case, 
then having load() be a separate method is not really needed, I think.  In 
the future it might make sense to use factories like the view objects do 
though.

-- 
George Staikos
KDE Developer			http://www.kde.org/
Staikos Computing Services Inc.	http://www.staikos.net/


More information about the Kst mailing list