Skip to content

Commit

Permalink
fix(scripting-mono): attach mono thread
Browse files Browse the repository at this point in the history
Sentry showing symptoms that are equivalent to the mono v1 environment being in a detached thread state, e.g.: missing `mono_thread_attach` or `mono_thread_detach`.
  • Loading branch information
thorium-cfx committed May 17, 2023
1 parent 1bb4056 commit 46b8470
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -269,6 +269,7 @@ static void InitMono()
// initializes the mono runtime
fx::mono::MonoComponentHostShared::Initialize();

mono_thread_attach(mono_get_root_domain());
g_rootDomain = mono_get_root_domain();

mono_add_internal_call("CitizenFX.Core.GameInterface::PrintLog", reinterpret_cast<void*>(GI_PrintLogCall));
Expand Down

0 comments on commit 46b8470

Please sign in to comment.