From: Robin Dunn Date: Fri, 18 May 2001 06:53:25 +0000 (+0000) Subject: Fixed OOR related problem in OGL X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/856e03b7538cb74a991ad18a13708583d8712fdd?ds=inline Fixed OOR related problem in OGL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/contrib/ogl/ogl.cpp b/wxPython/contrib/ogl/ogl.cpp index b6b50f6325..3b12bbd6f4 100644 --- a/wxPython/contrib/ogl/ogl.cpp +++ b/wxPython/contrib/ogl/ogl.cpp @@ -915,6 +915,21 @@ SWIGEXPORT(void) initoglc() { wxClassInfo::CleanUpClasses(); wxClassInfo::InitializeClasses(); + wxPyPtrTypeMap_Add("wxControlPoint", "wxPyControlPoint"); + wxPyPtrTypeMap_Add("wxShapeCanvas", "wxPyShapeCanvas"); + wxPyPtrTypeMap_Add("wxShapeEvtHandler", "wxPyShapeEvtHandler"); + wxPyPtrTypeMap_Add("wxShape", "wxPyShape"); + wxPyPtrTypeMap_Add("wxRectangleShape", "wxPyRectangleShape"); + wxPyPtrTypeMap_Add("wxDrawnShape", "wxPyDrawnShape"); + wxPyPtrTypeMap_Add("wxCompositeShape", "wxPyCompositeShape"); + wxPyPtrTypeMap_Add("wxDividedShape", "wxPyDividedShape"); + wxPyPtrTypeMap_Add("wxDivisionShape", "wxPyDivisionShape"); + wxPyPtrTypeMap_Add("wxEllipseShape", "wxPyEllipseShape"); + wxPyPtrTypeMap_Add("wxCircleShape", "wxPyCircleShape"); + wxPyPtrTypeMap_Add("wxLineShape", "wxPyLineShape"); + wxPyPtrTypeMap_Add("wxPolygonShape", "wxPyPolygonShape"); + wxPyPtrTypeMap_Add("wxTextShape", "wxPyTextShape"); + { int i; for (i = 0; _swig_mapping[i].n1; i++) diff --git a/wxPython/contrib/ogl/ogl.i b/wxPython/contrib/ogl/ogl.i index 8af76dd0ed..cf221345be 100644 --- a/wxPython/contrib/ogl/ogl.i +++ b/wxPython/contrib/ogl/ogl.i @@ -250,6 +250,21 @@ extern "C" SWIGEXPORT(void) initoglcanvasc(); wxClassInfo::CleanUpClasses(); wxClassInfo::InitializeClasses(); + wxPyPtrTypeMap_Add("wxControlPoint", "wxPyControlPoint"); + wxPyPtrTypeMap_Add("wxShapeCanvas", "wxPyShapeCanvas"); + wxPyPtrTypeMap_Add("wxShapeEvtHandler", "wxPyShapeEvtHandler"); + wxPyPtrTypeMap_Add("wxShape", "wxPyShape"); + wxPyPtrTypeMap_Add("wxRectangleShape", "wxPyRectangleShape"); + wxPyPtrTypeMap_Add("wxDrawnShape", "wxPyDrawnShape"); + wxPyPtrTypeMap_Add("wxCompositeShape", "wxPyCompositeShape"); + wxPyPtrTypeMap_Add("wxDividedShape", "wxPyDividedShape"); + wxPyPtrTypeMap_Add("wxDivisionShape", "wxPyDivisionShape"); + wxPyPtrTypeMap_Add("wxEllipseShape", "wxPyEllipseShape"); + wxPyPtrTypeMap_Add("wxCircleShape", "wxPyCircleShape"); + wxPyPtrTypeMap_Add("wxLineShape", "wxPyLineShape"); + wxPyPtrTypeMap_Add("wxPolygonShape", "wxPyPolygonShape"); + wxPyPtrTypeMap_Add("wxTextShape", "wxPyTextShape"); + %} //---------------------------------------------------------------------- diff --git a/wxPython/demo/wxOGL.py b/wxPython/demo/wxOGL.py index 63501224ae..a13bee893a 100644 --- a/wxPython/demo/wxOGL.py +++ b/wxPython/demo/wxOGL.py @@ -193,6 +193,7 @@ class TestWindow(wxShapeCanvas): if shape.GetParent() == None: shape.SetCanvas(None) shape.Destroy() + self.diagram.Destroy() #---------------------------------------------------------------------- diff --git a/wxPython/src/libpy.c b/wxPython/src/libpy.c index 450467bd13..7e400062a8 100644 --- a/wxPython/src/libpy.c +++ b/wxPython/src/libpy.c @@ -317,11 +317,11 @@ SWIG_GetPtr(char *c, void **ptr, char *t) if (*c != '_') { *ptr = (void *) 0; if (strcmp(c,"NULL") == 0) return (char *) 0; - else c; + else return c; } c++; /* Extract hex value from pointer */ - while (d = *c) { + while ((d = *c) != 0) { if ((d >= '0') && (d <= '9')) p = (p << 4) + (d - '0'); else if ((d >= 'a') && (d <= 'f')) diff --git a/wxPython/src/wxp.ico b/wxPython/src/wxp.ico index 60fc2b318b..7c8a4a5d03 100644 Binary files a/wxPython/src/wxp.ico and b/wxPython/src/wxp.ico differ