diff --git a/wxPython/wx/lib/masked/maskededit.py b/wxPython/wx/lib/masked/maskededit.py index 4bafe63712..dc78b9dc7e 100644 --- a/wxPython/wx/lib/masked/maskededit.py +++ b/wxPython/wx/lib/masked/maskededit.py @@ -4956,6 +4956,8 @@ class MaskedEditMixin: we need to pull the following trick: """ ## dbg('MaskedEditMixin::_OnFocus') + if self.IsBeingDeleted() or self.GetParent().IsBeingDeleted(): + return wx.CallAfter(self._fixSelection) event.Skip() self.Refresh()