Avoid editor error reporting using resource loader thread's call queues
This commit is contained in:
@@ -226,7 +226,7 @@ public:
|
||||
// Loaders can safely use this regardless which thread they are running on.
|
||||
static void notify_load_error(const String &p_err) {
|
||||
if (err_notify) {
|
||||
callable_mp_static(err_notify).call_deferred(p_err);
|
||||
MessageQueue::get_main_singleton()->push_callable(callable_mp_static(err_notify).bind(p_err));
|
||||
}
|
||||
}
|
||||
static void set_error_notify_func(ResourceLoadErrorNotify p_err_notify) {
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
if (Thread::get_caller_id() == Thread::get_main_id()) {
|
||||
dep_err_notify(p_path, p_dependency, p_type);
|
||||
} else {
|
||||
callable_mp_static(dep_err_notify).call_deferred(p_path, p_dependency, p_type);
|
||||
MessageQueue::get_main_singleton()->push_callable(callable_mp_static(dep_err_notify).bind(p_path, p_dependency, p_type));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +164,7 @@ class MessageQueue : public CallQueue {
|
||||
|
||||
public:
|
||||
_FORCE_INLINE_ static CallQueue *get_singleton() { return thread_singleton ? thread_singleton : main_singleton; }
|
||||
_FORCE_INLINE_ static CallQueue *get_main_singleton() { return main_singleton; }
|
||||
|
||||
static void set_thread_singleton_override(CallQueue *p_thread_singleton);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user