Commit 945aa06f authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #4111 from mshabunin:fix-flann-access

parents 81e1c043 fef7509e
......@@ -190,9 +190,13 @@ public:
void deallocate(UMatData* u) const
{
if(u)
if(!u)
return;
PyEnsureGIL gil;
CV_Assert(u->urefcount >= 0);
CV_Assert(u->refcount >= 0);
if(u->refcount == 0)
{
PyEnsureGIL gil;
PyObject* o = (PyObject*)u->userdata;
Py_XDECREF(o);
delete u;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment