X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7108497a54ee5de03bcea8de85e2750116c223e6..7e50db3f1dee16c59176f0f5dad2be787e7a5f9b:/wxPython/contrib/glcanvas/msw/glcanvas.py diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.py b/wxPython/contrib/glcanvas/msw/glcanvas.py index 6ae845efc3..a7b7b8dd67 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.py +++ b/wxPython/contrib/glcanvas/msw/glcanvas.py @@ -47,9 +47,12 @@ class wxGLContextPtr(wxObjectPtr): def __init__(self,this): self.this = this self.thisown = 0 - def __del__(self,glcanvasc=glcanvasc): - if self.thisown == 1 : - glcanvasc.delete_wxGLContext(self) + def __del__(self, delfunc=glcanvasc.delete_wxGLContext): + if self.thisown == 1: + try: + delfunc(self) + except: + pass def SetCurrent(self, *_args, **_kwargs): val = apply(glcanvasc.wxGLContext_SetCurrent,(self,) + _args, _kwargs) return val