X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaad759f90972578f8c8bfbf3218f496e0f8c547..53663be8a5ea8e1c6f178839209b67e8228e4642:/wxPython/src/msw/windows2.py diff --git a/wxPython/src/msw/windows2.py b/wxPython/src/msw/windows2.py index 1956c91f0e..b263d3c4c7 100644 --- a/wxPython/src/msw/windows2.py +++ b/wxPython/src/msw/windows2.py @@ -249,9 +249,12 @@ class wxTaskBarIconPtr(wxEvtHandlerPtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,windows2c=windows2c): - if self.thisown == 1 : - windows2c.delete_wxTaskBarIcon(self) + def __del__(self, delfunc=windows2c.delete_wxTaskBarIcon): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def SetIcon(self, *_args, **_kwargs): val = apply(windows2c.wxTaskBarIcon_SetIcon,(self,) + _args, _kwargs) return val