MCPcopy Create free account
hub / github.com/creatale/node-dv / cvDecRefData

Function cvDecRefData

deps/opencv/modules/core/include/opencv2/core/core_c.h:127–145  ·  view source on GitHub ↗

Decrements CvMat data reference counter and deallocates the data if it reaches 0 */

Source from the content-addressed store, hash-verified

125/* Decrements CvMat data reference counter and deallocates the data if
126 it reaches 0 */
127CV_INLINE void cvDecRefData( CvArr* arr )
128{
129 if( CV_IS_MAT( arr ))
130 {
131 CvMat* mat = (CvMat*)arr;
132 mat->data.ptr = NULL;
133 if( mat->refcount != NULL && --*mat->refcount == 0 )
134 cvFree( &mat->refcount );
135 mat->refcount = NULL;
136 }
137 else if( CV_IS_MATND( arr ))
138 {
139 CvMatND* mat = (CvMatND*)arr;
140 mat->data.ptr = NULL;
141 if( mat->refcount != NULL && --*mat->refcount == 0 )
142 cvFree( &mat->refcount );
143 mat->refcount = NULL;
144 }
145}
146
147/* Increments CvMat data reference counter */
148CV_INLINE int cvIncRefData( CvArr* arr )

Callers 2

cvReleaseMatFunction · 0.85
cvReleaseDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected