diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2018-12-06 17:02:40 +0200 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2018-12-06 17:25:57 +0200 |
commit | 68e69fd45b03f2c75a1314cef5cfe014e1432c00 (patch) | |
tree | 2ac894e7c780b56977ee9cbfafba63fda4c6c96a | |
parent | 9a8569d434107e721f5c7de0bf8ffe6471367d28 (diff) |
Make thumbnail cache less tasking on the message queue
Fixes #23567
-rw-r--r-- | core/message_queue.cpp | 2 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 5 | ||||
-rw-r--r-- | editor/editor_resource_preview.cpp | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/core/message_queue.cpp b/core/message_queue.cpp index abfc73407a..2952593798 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -209,9 +209,9 @@ void MessageQueue::statistics() { } break; } + } else { //object was deleted print_line("Object was deleted while awaiting a callback"); - } else { null_count++; } diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index b39f910182..81d9442656 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -830,11 +830,12 @@ void EditorFileDialog::update_file_list() { d["name"] = files.front()->get(); d["dir"] = false; String fullpath = cdir.plus_file(files.front()->get()); + d["path"] = fullpath; + item_list->set_item_metadata(item_list->get_item_count() - 1, d); + if (display_mode == DISPLAY_THUMBNAILS) { EditorResourcePreview::get_singleton()->queue_resource_preview(fullpath, this, "_thumbnail_result", fullpath); } - d["path"] = fullpath; - item_list->set_item_metadata(item_list->get_item_count() - 1, d); if (file->get_text() == files.front()->get()) item_list->set_current(item_list->get_item_count() - 1); diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 310c3b3a52..71e9aced7e 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -326,7 +326,7 @@ void EditorResourcePreview::queue_edited_resource_preview(const Ref<Resource> &p if (cache.has(path_id) && cache[path_id].last_hash == p_res->hash_edited_version()) { cache[path_id].order = order++; - p_receiver->call_deferred(p_receiver_func, path_id, cache[path_id].preview, cache[path_id].small_preview, p_userdata); + p_receiver->call(p_receiver_func, path_id, cache[path_id].preview, cache[path_id].small_preview, p_userdata); preview_mutex->unlock(); return; } @@ -351,7 +351,7 @@ void EditorResourcePreview::queue_resource_preview(const String &p_path, Object preview_mutex->lock(); if (cache.has(p_path)) { cache[p_path].order = order++; - p_receiver->call_deferred(p_receiver_func, p_path, cache[p_path].preview, cache[p_path].small_preview, p_userdata); + p_receiver->call(p_receiver_func, p_path, cache[p_path].preview, cache[p_path].small_preview, p_userdata); preview_mutex->unlock(); return; } |