From f8e549f767f867e7669cad3eaf1a3844ba02639e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 10 Apr 2013 00:05:50 +0000 Subject: [PATCH] Workaround to avoid problem possibly due to Unbind() not working. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/inspection.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wx/lib/inspection.py b/wx/lib/inspection.py index ba3ef434..1c7f0f79 100644 --- a/wx/lib/inspection.py +++ b/wx/lib/inspection.py @@ -265,14 +265,16 @@ class InspectionFrame(wx.Frame): def OnClose(self, evt): - self.SaveSettings(self.config) evt.Skip() + if not self: + return + self.SaveSettings(self.config) if hasattr(self, 'mgr'): self.mgr.UnInit() del self.mgr - if self.Parent: - tlw = self.Parent.GetTopLevelParent() - tlw.Unbind(wx.EVT_CLOSE, handler=self.OnClose) + if self.Parent: + tlw = self.Parent.GetTopLevelParent() + tlw.Unbind(wx.EVT_CLOSE, handler=self.OnClose) def UpdateInfo(self):