#!/usr/bin/python # -*- coding: utf-8 -*- import sys from PySide import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() sld = QtGui.QSlider(QtCore.Qt.Horizontal, self) vbox = QtGui.QVBoxLayout() vbox.addWidget(sld) self.setLayout(vbox) sld.valueChanged.connect(self.exampleFail) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Signal & slot') self.show() #Delete this bad boy sld.deleteLater() #Setup to fail QtCore.QTimer.singleShot (2000, self.exampleFail) #Keep a reference for us to use later around self.newref = sld def exampleFail(self): #The following causes a nice exception #self.newref.value() #The following causes a segfault self.newref.valueChanged.disconnect(self.exampleFail) def main(): app = QtGui.QApplication(sys.argv) ex = Example() sys.exit(app.exec_()) if __name__ == '__main__': main()