Skip to content

Commit

Permalink
Merge pull request #24194 from bojidar-bg/23567-fix-message-queue-ove…
Browse files Browse the repository at this point in the history
…rflow

Make thumbnail cache less tasking on the message queue
  • Loading branch information
akien-mga authored Dec 6, 2018
2 parents f2e7a65 + 68e69fd commit ce3f3a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/message_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ void MessageQueue::statistics() {
} break;
}

} else {
//object was deleted
print_line("Object was deleted while awaiting a callback");
} else {

null_count++;
}
Expand Down
5 changes: 3 additions & 2 deletions editor/editor_file_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions editor/editor_resource_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit ce3f3a9

Please sign in to comment.