Fix error on shutdown

Mentioned by NoGoodNews as well as Starfire, once you open the logs an error would present itself as follows:
RuntimeError: The SignalInstance object was already deleted
This commit is contained in:
Raffson 2024-02-09 19:20:29 +01:00
parent 3e373b706f
commit 4c13704630
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 4 additions and 3 deletions

View File

@ -543,7 +543,7 @@ class QLiberationWindow(QMainWindow):
LAYOUTS.import_templates()
def showLogsDialog(self):
self.dialog = QLogsWindow()
self.dialog = QLogsWindow(self)
self.dialog.show()
def onDebriefing(self, debrief: Debriefing):

View File

@ -8,6 +8,7 @@ from PySide6.QtWidgets import (
QPlainTextEdit,
QVBoxLayout,
QPushButton,
QWidget,
)
from qt_ui.logging_handler import HookableInMemoryHandler
@ -21,8 +22,8 @@ class QLogsWindow(QDialog):
clear_button: QPushButton
_logging_handler: typing.Optional[HookableInMemoryHandler]
def __init__(self):
super().__init__()
def __init__(self, parent: QWidget):
super().__init__(parent)
self.setWindowTitle("Logs")
self.setMinimumSize(400, 100)