X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f643d0600980076e063ac4937fc8a865b60eea1..27d98837f3b5589c40137f4a1fa75d28cde75c46:/wxPython/wx/lib/buttons.py?ds=sidebyside 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):