new_start_path = g_strdup(start_path);
- dir_array = g_ptr_array_new();
+ dir_array = g_ptr_array_new_with_free_func(g_free);
g_ptr_array_add(dir_array, start_path);
if (g_file_test(new_start_path, G_FILE_TEST_IS_DIR)) {
ms_register_end(uid);
ms_register_start(false, 0);
- current_path = g_ptr_array_index(dir_array, 0);
- g_ptr_array_remove_index(dir_array, 0);
+ current_path = g_ptr_array_steal_index(dir_array, 0);
__msc_set_dir_scan_cur_path(current_path);
new_start_path = g_strdup(start_path);
- dir_array = g_ptr_array_new();
+ dir_array = g_ptr_array_new_with_free_func(g_free);
g_ptr_array_add(dir_array, start_path);
if (ms_insert_folder(handle, storage_id, new_start_path, uid) != MS_MEDIA_ERR_NONE)
ms_register_start(false, 0);
- current_path = g_ptr_array_index(dir_array, 0);
- g_ptr_array_remove_index(dir_array, 0);
+ current_path = g_ptr_array_steal_index(dir_array, 0);
__msc_set_storage_scan_cur_path(current_path);