From a21409d5f6acf94141d2c7b766dfb606176a3ae3 Mon Sep 17 00:00:00 2001 From: Reef Turner Date: Wed, 14 Apr 2021 18:25:25 +0800 Subject: [PATCH] Work around wxWidgets assertion See #12220 --- source/gui/settingsDialogs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py index 37c306f0ce7..5f89eba8d7c 100644 --- a/source/gui/settingsDialogs.py +++ b/source/gui/settingsDialogs.py @@ -983,9 +983,17 @@ def onPanelDeactivated(self): super(SpeechSettingsPanel,self).onPanelDeactivated() def onDiscard(self): + # Work around wxAssertion error #12220 + # Manually destroying the ExpandoTextCtrl when the settings dialog is + # exited prevents the wxAssertion. + self.synthNameCtrl.Destroy() self.voicePanel.onDiscard() def onSave(self): + # Work around wxAssertion error #12220 + # Manually destroying the ExpandoTextCtrl when the settings dialog is + # exited prevents the wxAssertion. + self.synthNameCtrl.Destroy() self.voicePanel.onSave() class SynthesizerSelectionDialog(SettingsDialog): @@ -3194,9 +3202,17 @@ def onPanelDeactivated(self): super(BrailleSettingsPanel,self).onPanelDeactivated() def onDiscard(self): + # Work around wxAssertion error #12220 + # Manually destroying the ExpandoTextCtrl when the settings dialog is + # exited prevents the wxAssertion. + self.displayNameCtrl.Destroy() self.brailleSubPanel.onDiscard() def onSave(self): + # Work around wxAssertion error #12220 + # Manually destroying the ExpandoTextCtrl when the settings dialog is + # exited prevents the wxAssertion. + self.displayNameCtrl.Destroy() self.brailleSubPanel.onSave()