astrodatagui: close all database connections properly before exiting

This commit is contained in:
2024-03-04 12:44:31 +01:00
parent 4c458203d7
commit 05367dc1de
+10 -1
View File
@@ -11,6 +11,9 @@ class AstrodataGUI(QtWidgets.QMainWindow):
classFileDir = os.path.dirname(os.path.abspath(__file__))
absUiFilePath = os.path.join(classFileDir, "astrodatagui.ui")
uic.loadUi(absUiFilePath, self)
self.actionExit.triggered.connect(self.actionExitTriggered)
self.show()
self.loadDB()
@@ -25,4 +28,10 @@ class AstrodataGUI(QtWidgets.QMainWindow):
def showErrorMessage(self, title: str, msg: str):
print(title)
print(msg)
print(msg)
def actionExitTriggered(self):
for starDB in StarDB.getAllInstances():
starDB.close()
exit()