diff --git a/wx/lib/agw/aui/auibook.py b/wx/lib/agw/aui/auibook.py index d07637fe0..c63e31ecb 100644 --- a/wx/lib/agw/aui/auibook.py +++ b/wx/lib/agw/aui/auibook.py @@ -2457,7 +2457,8 @@ def GetPointedToTab(self): :rtype: :class:`wx.Window`. """ - + if not self: + return None # The AuiTabCtrl has already been destroyed screen_pt = wx.GetMousePosition() client_pt = self.ScreenToClient(screen_pt) return self.TabHitTest(client_pt.x, client_pt.y) diff --git a/wx/lib/agw/aui/framemanager.py b/wx/lib/agw/aui/framemanager.py index 0c5f56433..7cd5846ec 100644 --- a/wx/lib/agw/aui/framemanager.py +++ b/wx/lib/agw/aui/framemanager.py @@ -8435,6 +8435,10 @@ def OnRender(self, event): not part.sizer_item.IsShown()): continue + # don't draw items that have a pane whose window has been deleted + if part.pane and not part.pane.window: + continue + ptype = part.type if ptype in [AuiDockUIPart.typeDockSizer, AuiDockUIPart.typePaneSizer]: