Skip to content

Commit

Permalink
Merge pull request opencv#4111 from mshabunin:fix-flann-access
Browse files Browse the repository at this point in the history
  • Loading branch information
vpisarev committed Jun 22, 2015
2 parents 81e1c04 + fef7509 commit 945aa06
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/python/src2/cv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,13 @@ class NumpyAllocator : public MatAllocator

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;
Expand Down

0 comments on commit 945aa06

Please sign in to comment.