mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
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
This commit is contained in:
parent
380d1d4f18
commit
4d0fb67c53
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user