]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_pen.i
typo fix
[wxWidgets.git] / wxPython / src / _pen.i
index fc37c53409cff8934b81c808b5d57553445a67d0..5f9f7a278e25b4cc4478505b43a8563187889f48 100644 (file)
@@ -29,6 +29,8 @@
 %newgroup
 
 
+MustHaveApp(wxPen);
+
 class wxPen : public wxGDIObject {
 public:
     wxPen(wxColour& colour, int width=1, int style=wxSOLID);
@@ -56,8 +58,11 @@ public:
             int count = self->GetDashes(&dashes);
             bool blocked = wxPyBeginBlockThreads();
             PyObject* retval = PyList_New(0);
-            for (int x=0; x<count; x++)
-                PyList_Append(retval, PyInt_FromLong(dashes[x]));
+            for (int x=0; x<count; x++) {
+                PyObject* pyint = PyInt_FromLong(dashes[x]);
+                PyList_Append(retval, pyint);
+                Py_DECREF(pyint);
+            }
             wxPyEndBlockThreads(blocked);
             return retval;
         }