- 
    
Bug
 - 
    Resolution: Done
 - 
    
P2: Important
 - 
    None
 - 
    6.3.0
 - 
    None
 - 
    Python 3.10
 
- 
        
 - 
        5b8ca1b92d (pyside/pyside-setup/dev) 6a6238d525 (pyside/pyside-setup/6.3) 6a6238d525 (pyside/pyside-setup/wip/6.3_pypy) 6a6238d525 (pyside/tqtc-pyside-setup/6.3) 5b8ca1b92d (pyside/tqtc-pyside-setup/dev)
 
Hi PySide dev team,
 
 PyQtGraph dev here, we noticed a segfault on PySide6 6.3.0 and python 3.10 (this segfault does not occur on python 3.9 or python 3.8).  When the garbage collector cleans up an object that has a connected signal, this triggers a segfault.  Here is a minimum reproducible example, along with a commented-out fix.
import gc from PySide6 import QtCore class X(QtCore.QObject): signal = QtCore.Signal() def callback(self): pass child, parent = X(), X() parent._child = child child._parent = parent meta = child.signal.connect(parent.callback) print('before gc') del child, parent # uncomment to fix segfault # QtCore.QObject.disconnect(meta) gc.collect()
EDIT: messed up on a spacing issue in the code snippet, fixed now.
- relates to
 - 
                    
PYSIDE-1892 Segmentation fault with 6.3.0 on garbage collection
-         
     - Closed
 
 -         
 - 
                    
PYSIDE-803 QThread Freezes GUI
-         
 - Closed
 
 -         
 - 
                    
PYSIDE-813 Hard crash when emitting signal with argument into QThread
-         
 - Closed
 
 -