]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/gdi.cpp
Changes needed to solve wxPython's OOR problem for the wxOGL shapes.
[wxWidgets.git] / wxPython / src / msw / gdi.cpp
index 0f17d0f88582cddb3947e76f5c449264b257ca5f..cda64768c944780b15069a53decf8b1310609573 100644 (file)
@@ -190,13 +190,16 @@ public:
         { m_dash = NULL; }
     ~wxPyPen() {
         if (m_dash)
-            delete m_dash;
+            delete [] m_dash;
     }
 
     void SetDashes(int nb_dashes, const wxDash *dash) {
+        if (m_dash)
+            delete [] m_dash;
         m_dash = new wxDash[nb_dashes];
-        for (int i=0; i<nb_dashes; i++)
+        for (int i=0; i<nb_dashes; i++) {
             m_dash[i] = dash[i];
+        }
         wxPen::SetDashes(nb_dashes, m_dash);
     }