File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments