[PySide] Problems with QStyle deletion

John Ehresman jpe at wingware.com
Mon Nov 26 19:49:37 CET 2012

On 11/15/12 5:52 PM, John Ehresman wrote:
> I'm trying to fix a bug that causes segfaults if QApplication.style()
> and QApplication.setStyle() are used repeatedly.  I think the issue is:
> 1) a PyObject* is created for the QStyle* returned by style() and its
> shiboken parent is set to the global app which adds 1 to the refcount
> 2) the next call to setStyle delete's the C++ QStyle but the PyObject*
> remains in the binding map
> 3) at some future point, another C++ object is created with the same
> address as the first QStyle* and unpredictable errors occur if the new
> C++ object is not a QStyle

I've been looking further into this and am wondering why either the
destroyed signal and/or QWeakPointer are not used.  Is there a reason
why they're not used?



More information about the PySide mailing list