From kde-commits Mon Dec 06 10:38:58 2010 From: Kevin Ottens Date: Mon, 06 Dec 2010 10:38:58 +0000 To: kde-commits Subject: Re: KDE/kdelibs/kdecore Message-Id: <201012061139.04772.ervin () kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129163198631127 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart1383092.IyiqtIUYuM" --nextPart1383092.IyiqtIUYuM Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Monday 6 December 2010 11:12:13 David Faure wrote: > On Monday 06 December 2010, Aur=E9lien G=E2teau wrote: > > SVN commit 1204111 by gateau: > >=20 > > Do not crash if an job was deleted in a slot connected to result() >=20 > 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: >=20 > 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 (a= nd=20 that's why I wanted at least an assert in there so that it keeps crashing i= n=20 debug mode). =20 > 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 t= he > 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. =2D-=20 K=E9vin Ottens, http://ervin.ipsquad.net KDAB - proud patron of KDE, http://www.kdab.com --nextPart1383092.IyiqtIUYuM Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEABECAAYFAkz8vUgACgkQB0u7y43syeKYgACePYcyZ5QF5OZAm6kuiAXc7HHd N2gAoIwI68tDTp3iRpMC5vPJAFtUXJ/c =sIJr -----END PGP SIGNATURE----- --nextPart1383092.IyiqtIUYuM--