[PyQt] Slots being called on deleted QObjects

Phil Thompson phil at riverbankcomputing.com
Tue Apr 8 09:59:44 BST 2014


On 08-04-2014 9:31 am, Jeremy Sanders wrote:
> Phil Thompson wrote:
>
>
>> What would the default be? Reinstating the check by default would be
>> another incompatible change (though documented this time) but would 
>> be
>> fixing a 2 year old regression, and would be the "right thing" for 
>> the
>> vast majority of cases.
>>
>> Thoughts?
>
> In my opinion reverting it would be the right thing for most people.
> Personally, I've never wanted to get a signal on an object with a 
> destroyed
> QObject, but perhaps there's a use case somewhere (besides 
> destroyed?).
>
> Is there a merit to special-casing destroyed() and/or adding a flag 
> (to
> connect maybe) which will always deliver the signal to the object?

The latter was exactly what I was suggesting. The question was what the 
default value would be (ie. to keep the current behaviour or revert to 
the original behaviour).

Unless somebody else is going to object I'm inclined to revert (and 
introduce a documented incompatibility).

Phil


More information about the PyQt mailing list