git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25274
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-#----------------------------------------------------------------------
-# This creates some pens and brushes that the OGL library uses.
-
-ogl.OGLInitialize()
-
#----------------------------------------------------------------------
class DiamondShape(ogl.PolygonShape):
#----------------------------------------------------------------------
class DiamondShape(ogl.PolygonShape):
#----------------------------------------------------------------------
#----------------------------------------------------------------------
+# The OGL library holds some resources that need to be freed before
+# the app shuts down.
- cleanup = ogl.OGLCleanUp
- def __del__(self):
- self.cleanup()
+ def __del__(self, cleanup=ogl.OGLCleanUp):
+ cleanup()
-# when this module gets cleaned up then wx.OGLCleanUp() will get called
+# When this module gets cleaned up by Python then __cu will be cleaned
+# up and it's __dell__ is called, which will then call ogl.OGLCleanUp.