def METHOD_NAME(self, exit_code=0):
    threadpool = QThreadPool.globalInstance()
    threadpool.waitForDone()
    if self.timer is not None:
        self.timer.stop()
        self.timer.deleteLater()
        self.timer = None
    self.rcore.deleteLater()
    del self.rcore
    self.processEvents()
    shutil.rmtree(paths.tmp_dir())
    os.makedirs(paths.tmp_dir())
    self.exit(exit_code)