aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/bug_953.py
blob: 37ef28ea11f60db0a903fe4d5bfc3da16716a263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from PySide.QtCore import *

class Dispatcher(QObject):
    _me = None

    def __init__(self):
        super(Dispatcher, self).__init__()
        self._me = self
        QTimer.singleShot(0, self._finish)

    def _finish(self):
        del self._me # It can't crash here!
        QTimer.singleShot(10, QCoreApplication.instance().quit)

if __name__ == '__main__':
    app = QCoreApplication([])
    Dispatcher()
    app.exec_()