[ui][settings] fix memory cleaning

This commit is contained in:
Vinícius Moreira
2020-02-07 16:06:43 -03:00
parent 5be4e6c3de
commit 94d5a113a1

View File

@@ -1,7 +1,6 @@
import gc import gc
from io import StringIO from io import StringIO
from PyQt5 import sip
from PyQt5.QtCore import QSize, Qt from PyQt5.QtCore import QSize, Qt
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QToolBar, QSizePolicy, QPushButton from PyQt5.QtWidgets import QWidget, QVBoxLayout, QToolBar, QSizePolicy, QPushButton
@@ -52,14 +51,13 @@ class SettingsWindow(QWidget):
def closeEvent(self, event): def closeEvent(self, event):
if self.window and self.window.settings_window == self: if self.window and self.window.settings_window == self:
sip.delete(self.window.settings_window) self.deleteLater()
self.window.settings_window = None self.window.settings_window = None
elif self.tray and self.tray.settings_window == self: elif self.tray and self.tray.settings_window == self:
sip.delete(self.tray.settings_window) self.deleteLater()
self.tray.settings_window = None self.tray.settings_window = None
gc.collect() gc.collect()
event.accept()
def handle_display(self): def handle_display(self):
if self.isMinimized(): if self.isMinimized():