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

John Ehresman jpe at wingware.com
Wed May 30 21:22:24 CEST 2012


I'm getting a segfault when I run the following:

w.selectionModel().selectionChanged.connect(callback)

with updated sources from git.  I can work around it with

m = w.selectionModel()
m.selectionChanged.connect(callback)

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

Oddly this only happens in a larger program and not in a simple test 
case, but I don't see how source can be assumed to be valid without 
increfing it.

Thanks,

John



More information about the PySide mailing list