]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/glcanvas/msw/glcanvas.py
SWIGged updates for wxMSW
[wxWidgets.git] / wxPython / contrib / glcanvas / msw / glcanvas.py
index 6ae845efc30d12ef57171b02bce3b5f26e50b1be..a7b7b8dd6706d40e5476cf74d32200bd7b9d9932 100644 (file)
@@ -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