Skip to content

Commit e878b60

Browse files
committed
core: drop type/dims/rows/cols information in Mat::release()
1 parent 979b0ae commit e878b60

File tree

1 file changed

+10
-0
lines changed
  • modules/core/include/opencv2/core

1 file changed

+10
-0
lines changed

modules/core/include/opencv2/core/mat.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,16 @@ inline void Mat::release()
368368
data = datastart = dataend = datalimit = 0;
369369
for(int i = 0; i < dims; i++)
370370
size.p[i] = 0;
371+
#ifdef _DEBUG
372+
flags = MAGIC_VAL;
373+
dims = rows = cols = 0;
374+
if (step.p != step.buf)
375+
{
376+
fastFree(step.p);
377+
step.p = step.buf;
378+
size.p = &rows;
379+
}
380+
#endif
371381
refcount = 0;
372382
}
373383

0 commit comments

Comments
 (0)