1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

App: Do a bit more cleanup to avoid crashes

This commit is contained in:
loathingKernel 2022-09-02 00:20:04 +03:00
parent 3c5575fda9
commit dfb388a9ba

View file

@ -211,7 +211,7 @@ class App(RareApp):
logger.info("Show App")
def exit_app(self, exit_code=0):
# FIXME: Fix this with the downlaod tab redesign
# FIXME: Fix this with the download tab redesign
if self.mainwindow is not None:
if not self.args.offline and self.mainwindow.tab_widget.downloadTab.is_download_active:
question = QMessageBox.question(
@ -237,8 +237,15 @@ class App(RareApp):
self.core.exit()
if self.mainwindow is not None:
self.mainwindow.close()
self.mainwindow.deleteLater()
self.mainwindow = None
if self.tray_icon is not None:
self.tray_icon.deleteLater()
self.tray_icon = None
if self.timer is not None:
self.timer.stop()
self.timer.deleteLater()
self.timer = None
self.processEvents()
shutil.rmtree(tmp_dir)
os.makedirs(tmp_dir)