[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Suspected KParts problem update
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-03-16 10:26:11
[Download RAW message or body]

On Thu, Mar 16, 2000 at 09:35:56PM +1100, Don Sanders wrote:
> You guys awake yet? 
Yes

> The suspected KParts bug (Konqueror and KMail crashing on 
> exit) is still open right?
No.
Konqueror doesn't crash here - but I admit some workarounds for
QLayout strange bugs (related to deletion) are in.

> Well it's 'caused' by the "delete (QWidget *)m_widget;" statement in 
> kparts/part.cpp
> 
> Part::~Part()
> {
>   if ( m_widget )
>   {
>     // We need to disconnect first, to avoid calling it !
>     disconnect( m_widget, SIGNAL( destroyed() ),
>                 this, SLOT( slotWidgetDestroyed() ) );
>     kdDebug(1000) << "deleting widget " << m_widget->name() << endl;
>         delete (QWidget *)m_widget; // <<<< sanders - I'm guilty!! <<<<<<
>   }
> 
>   delete d;
> }
> 
> Even without this delete statement m_widget is still deleted. 

You mean, when the parent is deleted ?
The delete statement is very much needed here, in case the parent
widget is NOT deleted (but just the part).
It used to work fine... but relying on Qt accepting that
we delete the object ourselves, even when the parent is deleted
(first, probably)

> But with it 
> m_widget is attempted to be deleted twice. (Without the delete statement both 
> KMail and Konqueror exit normally that is they don't segfault)
Yes but they leak memory each time a part is deleted.

> So this is very similar to the recent KStatusBar problem. I have reported 
> that problem to Troll Tech so hopefully it will fix this KParts (or really 
> QT) bug too.

So this _is_ a Qt bug, right ? It's still acceptable to delete
a widget manually, even though the parent widget tries to
delete it too ?

Thanks for having reported the bug to them.

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic