bool is_recursive = (msg_type == MS_MSG_DIRECTORY_SCANNING);
char *new_start_path = NULL;
+ bool is_stop_scan = false;
+
int scan_count = 0;
int sleep_count = 0;
goto END_SCAN;
STOP_SCAN:
- MS_DBG_ERR("stop folder scan...");
- ms_set_folder_scan_status(storage_id, current_path, MS_DIR_SCAN_STOP, uid);
- MS_SAFE_FREE(current_path);
+ is_stop_scan = true;
END_SCAN:
if (dir) {
dir = NULL;
}
+ if(is_stop_scan) {
+ MS_DBG_ERR("stop folder scan...");
+ ms_set_folder_scan_status(storage_id, current_path, MS_DIR_SCAN_STOP, uid);
+ MS_SAFE_FREE(current_path);
+ }
+
g_free(new_start_path);
__msc_set_dir_scan_cur_path(NULL);
int (*scan_function)(sqlite3 *, const char*, const char*, uid_t) = NULL;
char *new_start_path = NULL;
+ bool is_stop_scan = false;
+
int scan_count = 0;
int sleep_count = 0;
goto END_SCAN;
STOP_SCAN:
- if (current_path != NULL)
- ms_set_folder_scan_status(storage_id, current_path, MS_DIR_SCAN_STOP, uid);
- MS_SAFE_FREE(current_path);
+ is_stop_scan = true;
END_SCAN:
if (dir) {
dir = NULL;
}
+ if(is_stop_scan) {
+ if (current_path != NULL)
+ ms_set_folder_scan_status(storage_id, current_path, MS_DIR_SCAN_STOP, uid);
+ MS_SAFE_FREE(current_path);
+ }
+
g_free(new_start_path);
__msc_set_storage_scan_cur_path(NULL);
g_ptr_array_free(dir_array, TRUE);