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

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdecore
From:       Kevin Ottens <ervin () kde ! org>
Date:       2010-12-06 10:38:58
Message-ID: 201012061139.04772.ervin () kde ! org
[Download RAW message or body]


On Monday 6 December 2010 11:12:13 David Faure wrote:
> On Monday 06 December 2010, Aurélien Gâteau wrote:
> > SVN commit 1204111 by gateau:
> > 
> > Do not crash if an job was deleted in a slot connected to result()
> 
> I don't agree that this is a valid use case.
>
> The rules are clear: do not delete an object in a slot connected to one of
> its signals. This is exactly why deleteLater() exists. I remember e.g.
> fixing code that used a socket and called delete in the slot for
> disconnected, instead of deleteLater... there, it's even documented:
> 
> void QAbstractSocket::disconnected ()
> [...]
> Warning: If you need to delete the sender() of this signal in a slot
> connected to it, use the deleteLater() function.
> [...]

Was my position as well. This patch is mainly the result of a compromise (and 
that's why I wanted at least an assert in there so that it keeps crashing in 
debug mode).
 
> In addition, you added a guard in kjob.cpp itself, but what about the moc-
> generated code in between? When deleting the sender, we then go back to the
> signal emission code inside of a deleted object...

Ah! Very good point, I didn't think about that one...

> I think this commit should be reverted.

With the extra background provided by David I have to agree there as well.

/me filthy little worm, bows to David's greatness. :-)

Regards.
-- 
Kévin Ottens, http://ervin.ipsquad.net

KDAB - proud patron of KDE, http://www.kdab.com

["signature.asc" (application/pgp-signature)]

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

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