mv_handle* _handle = (mv_handle*)handle;
+ dcm_retvm_if(_handle == NULL, FACE_ERROR_INVALID_PARAMTER, "invalid handle");
+
dcm_info("dcm_face_engine destroy. handle=0x%08x", handle);
- err = mv_destroy_engine_config(_handle->cfg);
- if (err != MEDIA_VISION_ERROR_NONE) {
- dcm_error("Fail to mv_destroy_engine_config");
- return __convert_to_mv_error_e(err);
+ if (_handle->cfg != NULL) {
+ err = mv_destroy_engine_config(_handle->cfg);
+ if (err != MEDIA_VISION_ERROR_NONE) {
+ dcm_error("Fail to mv_destroy_engine_config");
+ return __convert_to_mv_error_e(err);
+ }
}
- err = mv_destroy_source(_handle->source);
- if (err != MEDIA_VISION_ERROR_NONE) {
- dcm_error("Fail to mv_destroy_source");
- return __convert_to_mv_error_e(err);
+ if (_handle->source != NULL) {
+ err = mv_destroy_source(_handle->source);
+ if (err != MEDIA_VISION_ERROR_NONE) {
+ dcm_error("Fail to mv_destroy_source");
+ return __convert_to_mv_error_e(err);
+ }
}
return FACE_ERROR_NONE;
mv_faceInfo result;
dcm_retvm_if(handle == NULL, FACE_ERROR_OUT_OF_MEMORY, "invalid handle");
+ dcm_retvm_if(handle->fengine == NULL, FACE_ERROR_OUT_OF_MEMORY, "invalid handle");
dcm_retvm_if(face_rect == NULL, FACE_ERROR_OUT_OF_MEMORY, "invalid face_rect");
dcm_retvm_if(count == NULL, FACE_ERROR_OUT_OF_MEMORY, "invalid count");
int DcmScanSvc::createQuitTimerScanThread()
{
- GSource *quit_timer = NULL;
-
dcm_debug_fenter();
if (scan_thread_quit_timer != NULL) {
scan_thread_quit_timer = NULL;
}
- quit_timer = g_timeout_source_new_seconds(DCM_SVC_SCAN_THREAD_TIMEOUT_SEC);
- DCM_CHECK_VAL(quit_timer, DCM_ERROR_OUT_OF_MEMORY);
+ scan_thread_quit_timer = g_timeout_source_new_seconds(DCM_SVC_SCAN_THREAD_TIMEOUT_SEC);
+ DCM_CHECK_VAL(scan_thread_quit_timer, DCM_ERROR_OUT_OF_MEMORY);
- g_source_set_callback(quit_timer, DcmScanCallback::quitTimerAtScanThread, (gpointer)this, NULL);
- g_source_attach(quit_timer, scan_thread_main_context);
- scan_thread_quit_timer = quit_timer;
+ g_source_set_callback(scan_thread_quit_timer, DcmScanCallback::quitTimerAtScanThread, (gpointer)this, NULL);
+ g_source_attach(scan_thread_quit_timer, scan_thread_main_context);
dcm_debug_fleave();
scan_single_item_list = NULL;
scan_single_curr_index = 0;
g_scan_cancel = FALSE;
+ scan_thread_quit_timer = NULL;
DcmFaceUtils::initialize();
dcmDBUtils = DcmDbUtils::getInstance();