Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Area.py2
-rw-r--r--fill/fillmodule.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/Area.py b/Area.py
index 9318266..6236bb0 100644
--- a/Area.py
+++ b/Area.py
@@ -865,10 +865,12 @@ class Area(Gtk.DrawingArea):
pixels2 = fill(pixels, x, y, width, height, fill_color)
# the c implementation returns a list instead of array.array
pixels = array.array(_array_type_used, pixels2)
+ del(pixels2)
# create a updated drawing_canvas
self.drawing_canvas_data = cairo.ImageSurface.create_for_data(pixels,
cairo.FORMAT_ARGB32, width, height)
+ del(pixels)
self.setup(width, height)
self.queue_draw()
diff --git a/fill/fillmodule.c b/fill/fillmodule.c
index e9b461c..6e4823c 100644
--- a/fill/fillmodule.c
+++ b/fill/fillmodule.c
@@ -71,6 +71,7 @@ static PyObject* fill(PyObject* self, PyObject* args)
item = PySequence_GetItem(mylist, index);
/* assign to the C array */
intarr[index] = PyLong_AsUnsignedLong(item);
+ Py_DECREF(item);
}
/* now use intarr and arrsize in you extension */
@@ -81,8 +82,8 @@ static PyObject* fill(PyObject* self, PyObject* args)
for (index = 0; index < arrsize; index++) {
PyTuple_SetItem(pylist, index, PyLong_FromUnsignedLong(intarr[index]));
}
-
- return Py_BuildValue("O", pylist);
+ free(intarr);
+ return pylist;
}