5151
5252static volatile bool g_isEnabled = false;
5353static bool g_isSigtermReportingEnabled = false;
54- static bool g_isManagedRuntime = false;
5554
5655static SentryCrash_MonitorContext g_monitorContext ;
5756static SentryCrashStackCursor g_stackCursor ;
@@ -110,9 +109,9 @@ handleSignal(int sigNum, siginfo_t *signalInfo, void *userContext)
110109{
111110 SENTRY_ASYNC_SAFE_LOG_DEBUG ("Trapped signal %d" , sigNum );
112111
113- // Let managed Mono/CoreCLR runtime handle the signal first,
114- // as they may convert it into a managed exception.
115- if ( g_isManagedRuntime ) {
112+ if ( sentrycrashcm_isManagedRuntime ()) {
113+ // Let managed Mono/CoreCLR runtime handle the signal first,
114+ // as they may convert it into a managed exception.
116115 SENTRY_ASYNC_SAFE_LOG_DEBUG (
117116 "Detected managed Mono/CoreCLR runtime. Passing signal to previous handlers." );
118117
@@ -161,7 +160,7 @@ handleSignal(int sigNum, siginfo_t *signalInfo, void *userContext)
161160
162161 // Re-raise the signal to invoke the previous handlers unless already called
163162 // above for managed runtimes.
164- if (!g_isManagedRuntime ) {
163+ if (!sentrycrashcm_isManagedRuntime () ) {
165164 SENTRY_ASYNC_SAFE_LOG_DEBUG ("Re-raising signal for regular handlers to catch." );
166165 // This is technically not allowed, but it works in OSX and iOS.
167166 raise (sigNum );
@@ -177,8 +176,6 @@ installSignalHandler(void)
177176{
178177 SENTRY_ASYNC_SAFE_LOG_DEBUG ("Installing signal handler." );
179178
180- g_isManagedRuntime = sentrycrashcm_isManagedRuntime ();
181-
182179# if SENTRY_HAS_SIGNAL_STACK
183180
184181 if (g_signalStack .ss_size == 0 ) {
0 commit comments