[PySide] Is there a reason PySideSignalInstance source isn't incref'd?

John Ehresman jpe at wingware.com
Fri Jun 8 17:46:47 CEST 2012


On 5/31/12 10:27 AM, John Ehresman wrote:
> On 5/31/12 9:44 AM, Hugo Parente Lima wrote:
>>> Stepping through the code in pysidesignal.cpp, it looks like d->source
>>> of a PySideSignalInstance object isn't incref'd so when the temporary
>>> ref returned by selectionModel is decref'd, the source is pointing at a
>>> invalid object.  The function that initializes a PySideSignalInstance is
>>> instanceInitialize
>>
>> When we delete an QObject we want to have all their connections disconnected,
>> e.g.
>>
>> o = QObject()
>> o.connect(...)
>> del o
>> # The object must be destroyed and all connections disconnected.
>>
>> But if the connection holds a reference to the sender this will never happen,
>> IIRC we currently hold a weakref.

I created a bug report for this at 
https://bugreports.qt-project.org/browse/PYSIDE-79  It looks like just 
INCREFing the source isn't the solution.  I'd appreciate any hints of 
what the right approach here might be.

Is there any way to encourage more people to look at bugs?  I'd like to 
get more feedback from developers who are familiar with pyside's 
implementation if possible.

Thanks,

John



More information about the PySide mailing list