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

(cherry picked from commit 4d0fb67c53)
This commit is contained in:
Dan Albert
2021-06-25 16:28:24 -07:00
parent d187c571ea
commit 278b9730cd

View File

@@ -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)