Persistence of KParts plugins
David Faure
dfaure at trolltech.com
Tue Jul 15 09:01:29 BST 2003
On Monday 14 July 2003 19:32, Antonio Larrosa Jiménez wrote:
> Hi,
>
> I forgot to ask to Cc: me, as I'm not on the list.
>
> > Your dialog has the plugin as parent? Change that to 0, so that
> > the dialog can't be deleted by any other means than itself being closed
> > (use e.g. WDestructiveClose).
> [...]
> > kapp->ref() when showing the dialog, kapp->deref() when closing it.
> > This will ensure that the process doesn't exit until the dialog is closed.
>
> Thanks, I've done those things and it works better. I've also copied the DOM
> tree as we talked on IRC so that there's no problem when the user navigates
> to another web page.
>
> But still, when the dialog appears and it starts downloading, closing the html part
> (that is, opening a file icon view instead of khtml, or closing the window) makes it
> crash in a KHTML's assert.
>
> The stdout is:
> konqueror: KonqMainWindow::openView ok=true bOthersFollowed=false returning true
> khtml: KHTMLFactory::~KHTMLFactory
> konqueror: /home/antonio/cvs/kde/kdelibs/khtml/misc/loader.cpp:1328: static void khtml::Cache::clear(): La declaración `it.current()->canDelete()' no se cumple.
>
> where the last part is a false assert, and loder.cpp:1328 is the following assert line:
>
> for (QDictIterator<CachedObject> it(*cache); it.current(); ++it)
> assert(it.current()->canDelete());
>
> The first thing I tried to do is to keep a KHTMLFactory reference in the web
> archiver plugin so that it isn't destroyed until I finished with it, but
> khtml_factory.h is not even installed, so that doesn't seem to be the solution.
>
> Any idea of what's going wrong?
Your DOM tree keeps refcounts on KHTML's stuff, which can't destroy itself properly.
I'd suggest a deep copy of the DOM tree then (cloneNode(true)).
--
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html
More information about the kfm-devel
mailing list