From 4d0fb67c5331890b1bb69241efef4000d0319d6e Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 25 Jun 2021 16:28:24 -0700 Subject: [PATCH] Fix crash when buying or selling TGO units. Updating the game destroys this window so we cannot continue with the calls. It worked in my initial testing, so presumably it's partly dependent on when the finalizers run. Since the windows will be destroyed there's nothing for us to actually update, so just remove that signal and the explicit close calls. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1344 --- qt_ui/windows/groundobject/QGroundObjectMenu.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/qt_ui/windows/groundobject/QGroundObjectMenu.py b/qt_ui/windows/groundobject/QGroundObjectMenu.py index ca827c00..b04750ee 100644 --- a/qt_ui/windows/groundobject/QGroundObjectMenu.py +++ b/qt_ui/windows/groundobject/QGroundObjectMenu.py @@ -264,14 +264,10 @@ class QGroundObjectMenu(QDialog): self.subwindow = QBuyGroupForGroundObjectDialog( self, self.ground_object, self.cp, self.game, self.total_value ) - self.subwindow.changed.connect(self.do_refresh_layout) self.subwindow.show() class QBuyGroupForGroundObjectDialog(QDialog): - - changed = QtCore.Signal() - def __init__( self, parent, @@ -436,9 +432,6 @@ class QBuyGroupForGroundObjectDialog(QDialog): GameUpdateSignal.get_instance().updateGame(self.game) - self.changed.emit() - self.close() - def buySam(self): sam_generator = self.samCombo.itemData(self.samCombo.currentIndex()) price = sam_generator.price - self.current_group_value @@ -455,9 +448,6 @@ class QBuyGroupForGroundObjectDialog(QDialog): GameUpdateSignal.get_instance().updateGame(self.game) - self.changed.emit() - self.close() - def buy_ewr(self): ewr_generator = self.ewr_selector.itemData(self.ewr_selector.currentIndex()) price = ewr_generator.price() - self.current_group_value @@ -473,9 +463,6 @@ class QBuyGroupForGroundObjectDialog(QDialog): GameUpdateSignal.get_instance().updateGame(self.game) - self.changed.emit() - self.close() - def error_money(self): msg = QMessageBox() msg.setIcon(QMessageBox.Information)