keditbookmarks crash, KParts related

David Faure faure at kde.org
Fri Jun 10 16:23:55 BST 2005


On Friday 10 June 2005 17:17, Koos Vriezen wrote:
> On Fri, Jun 10, 2005 at 04:35:19PM +0200, Daniel Teske wrote:
> > Hi
> > 
> > could someone who knows more than me about KParts look over this patch 
> > and tell me wheter I guessed correctly?
> > (That I need to delete s_part and that I can reuse it.)
> > 
> > The crash is easily reproduced: Simply selecet File/Print - Cancel - 
> > File/Quit.
> 
> QGuardedPtr ?

A KParts is a qobject and a qwidget. Both are automatically deleted when either
one gets deleted, so if you close the window, the widget tree gets deleted,
this deletes the part, and then s_part is double-deleted. So QGuardedPtr is indeed
a solution.

For KDE4 I plan to remove this magic from KParts, it's just too much trouble
(like in this case; it's really unexpected that s_part gets deleted on you).

About reusing: isn't that just a waste of memory, since it's about a rare action?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kfm-devel mailing list