projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06b06d5
)
Fixed leak of dims in MatND creates
author
James Bowman
<no@email>
Wed, 19 Jan 2011 01:43:45 +0000
(
01:43
+0000)
committer
James Bowman
<no@email>
Wed, 19 Jan 2011 01:43:45 +0000
(
01:43
+0000)
modules/python/cv.cpp
patch
|
blob
|
history
tests/python/leak2.py
patch
|
blob
|
history
diff --git
a/modules/python/cv.cpp
b/modules/python/cv.cpp
index 61cdd54d1e3217eb8114f33b4cffef58b9c8d684..6cbe1d94d46d0567881311fbd72231e5646f62c7 100644
(file)
--- a/
modules/python/cv.cpp
+++ b/
modules/python/cv.cpp
@@
-2793,6
+2793,7
@@
static PyObject *pycvCreateMatNDHeader(PyObject *self, PyObject *args)
m->data = Py_None;
Py_INCREF(m->data);
+ delete [] dims.i;
return (PyObject*)m;
}
@@
-2806,6
+2807,7
@@
static PyObject *pycvCreateMatND(PyObject *self, PyObject *args)
return NULL;
cvmatnd_t *m = PyObject_NEW(cvmatnd_t, &cvmatnd_Type);
ERRWRAP(m->a = cvCreateMatND(dims.count, dims.i, type));
+ delete [] dims.i;
return pythonize_CvMatND(m);
}
diff --git
a/tests/python/leak2.py
b/tests/python/leak2.py
index 2a3d4ae2121de64dab97d8e7999bdf2524cb140f..a67352f1979e6342d68bb0abe6ad69c3582248ca 100644
(file)
--- a/
tests/python/leak2.py
+++ b/
tests/python/leak2.py
@@
-6,5
+6,5
@@
while True:
for i in range(4000):
a = cv.CreateImage((1024,1024), cv.IPL_DEPTH_8U, 1)
b = cv.CreateMat(1024, 1024, cv.CV_8UC1)
-
#
c = cv.CreateMatND([1024,1024], cv.CV_8UC1)
+ c = cv.CreateMatND([1024,1024], cv.CV_8UC1)
print "pause..."