universal functions */
| 4954 | |
| 4955 | /* universal functions */ |
| 4956 | CV_IMPL void |
| 4957 | cvRelease( void** struct_ptr ) |
| 4958 | { |
| 4959 | CvTypeInfo* info; |
| 4960 | |
| 4961 | if( !struct_ptr ) |
| 4962 | CV_Error( CV_StsNullPtr, "NULL double pointer" ); |
| 4963 | |
| 4964 | if( *struct_ptr ) |
| 4965 | { |
| 4966 | info = cvTypeOf( *struct_ptr ); |
| 4967 | if( !info ) |
| 4968 | CV_Error( CV_StsError, "Unknown object type" ); |
| 4969 | if( !info->release ) |
| 4970 | CV_Error( CV_StsError, "release function pointer is NULL" ); |
| 4971 | |
| 4972 | info->release( struct_ptr ); |
| 4973 | *struct_ptr = 0; |
| 4974 | } |
| 4975 | } |
| 4976 | |
| 4977 | |
| 4978 | void* cvClone( const void* struct_ptr ) |