mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Prevent off-thread errors when generating resource previews for animation nodes
This commit is contained in:
parent
296de7da83
commit
c82c5b0701
1 changed files with 2 additions and 1 deletions
|
|
@ -234,7 +234,8 @@ bool AnimationTreeEditor::can_edit(const Ref<AnimationNode> &p_node) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<String> AnimationTreeEditor::get_animation_list() {
|
Vector<String> AnimationTreeEditor::get_animation_list() {
|
||||||
if (!singleton->tree || !singleton->is_visible()) {
|
// This can be called off the main thread due to resource preview generation. Quit early in that case.
|
||||||
|
if (!singleton->tree || !Thread::is_main_thread() || !singleton->is_visible()) {
|
||||||
// When tree is empty, singleton not in the main thread.
|
// When tree is empty, singleton not in the main thread.
|
||||||
return Vector<String>();
|
return Vector<String>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue