[Kst] Strange problem using the change data file tool

George Staikos staikos at kde.org
Thu Feb 23 13:35:11 CET 2006


On Monday 20 February 2006 13:29, Brisset, Nicolas wrote:
> It seems that showPage() creates a first instance, and finished() needs
> another one for some reason I have not yet understood. Interestingly,
> the KST::dataSourceList.lock().writeLock() method is only called in one
> place. I expected a symmetrical construct for removing a datasource, but
> I did not find it. To sum up, I haven't yet found who destroys the first
> instance, but for sure it disappears between showPage() and finished().

We could do this:

Index: datawizard.ui.h
===================================================================
--- datawizard.ui.h     (revision 512716)
+++ datawizard.ui.h     (working copy)
@@ -252,6 +252,9 @@
        KstDataSourcePtr ds = 
*KST::dataSourceList.findReusableFileName(_file);
        if (!ds) {
            ds = KstDataSource::loadSource(_file);
+           KST::dataSourceList.lock().writeLock();
+           KST::dataSourceList.append(ds);
+           KST::dataSourceList.lock().writeUnlock();
        }
        ds->readLock();
        _kstDataRange->setAllowTime(ds && ds->supportsTimeConversions());


The reason it wasn't done in the past was that we don't want to hold onto a 
datasource that isn't being used.  It's possible that a datasource instance 
takes up quite a bit of memory.  Does this patch make it work any better for 
you?

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


More information about the Kst mailing list