Skip to content

Commit 93853ef

Browse files
authored
Merge c562306 into 61000de
2 parents 61000de + c562306 commit 93853ef

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

source/gui/settingsDialogs.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,17 @@ def onApply(self, evt):
274274
self.postInit()
275275
self.SetReturnCode(wx.ID_APPLY)
276276

277-
def _onWindowDestroy(self, evt):
278-
evt.Skip()
279-
self._setInstanceDestroyedState()
277+
def _onWindowDestroy(self, evt: wx.WindowDestroyEvent):
278+
# Destroy events are sent to parent windows for handling.
279+
# If a child window is being destroyed, we don't want to
280+
# set this object as destroyed.
281+
# The ExpandoTextCtrl creates a destroy event as part of
282+
# initialization, this caused the NVDASettings dialog
283+
# to be incorrectly set to destroyed, causing #12818.
284+
isSelfAlive = bool(self)
285+
if not isSelfAlive:
286+
evt.Skip()
287+
self._setInstanceDestroyedState()
280288

281289
# An event and event binder that will notify the containers that they should
282290
# redo the layout in whatever way makes sense for their particular content.

0 commit comments

Comments
 (0)