aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/tests/QtCore/bug_953.py
blob: 13f834c589b4d29cf6d6ca7dfc9fecce16024acc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from PySide2.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_()