Decrements CvMat data reference counter and deallocates the data if it reaches 0 */
| 125 | /* Decrements CvMat data reference counter and deallocates the data if |
| 126 | it reaches 0 */ |
| 127 | CV_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 */ |
| 148 | CV_INLINE int cvIncRefData( CvArr* arr ) |
no outgoing calls
no test coverage detected