From 4e20fcc5517f3a638e45a6c826e81e5dd0b62ce4 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 4 May 2006 02:18:25 +0000 Subject: [PATCH] Ensure the button still exists after the Notify before doing anything with it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/wx/lib/buttons.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wxPython/wx/lib/buttons.py b/wxPython/wx/lib/buttons.py index efb71b8e8a..e01fd4b55b 100644 --- a/wxPython/wx/lib/buttons.py +++ b/wxPython/wx/lib/buttons.py @@ -312,8 +312,9 @@ class GenButton(wx.PyControl): if not self.up: # if the button was down when the mouse was released... self.Notify() self.up = True - self.Refresh() - event.Skip() + if self: # in case the button was destroyed in the eventhandler + self.Refresh() + event.Skip() def OnMotion(self, event): -- 2.50.0