worker.finished.connect(self.thread.quit)
self.thread.started.connect(worker.process)

def cleanup():
    self.thread.started.disconnect(worker.process)
self.thread.finished.disconnect(cleanup)
worker.deleteLater()
self.thread.finished.connect(cleanup)
self.thread.start()
Do QThreads control destruction of stack-created QObjects pushed to it?