Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let EditorLog use the right call queue for thread safety #94079

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions editor/editor_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f

MessageType message_type = p_type == ERR_HANDLER_WARNING ? MSG_TYPE_WARNING : MSG_TYPE_ERROR;

if (self->current != Thread::get_caller_id()) {
callable_mp(self, &EditorLog::add_message).call_deferred(err_str, message_type);
if (!Thread::is_main_thread()) {
MessageQueue::get_main_singleton()->push_callable(callable_mp(self, &EditorLog::add_message), err_str, message_type);
} else {
self->add_message(err_str, message_type);
}
Expand Down Expand Up @@ -557,8 +557,6 @@ EditorLog::EditorLog() {
eh.errfunc = _error_handler;
eh.userdata = this;
add_error_handler(&eh);

current = Thread::get_caller_id();
}

void EditorLog::deinit() {
Expand Down
2 changes: 0 additions & 2 deletions editor/editor_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ class EditorLog : public HBoxContainer {

ErrorHandlerList eh;

Thread::ID current;

//void _dragged(const Point2& p_ofs);
void _meta_clicked(const String &p_meta);
void _clear_request();
Expand Down
Loading