Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
philipphofmann committed Jun 3, 2024
1 parent 9ad3f0e commit 918f61a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 5 additions & 7 deletions Sources/Sentry/SentryCrashIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ - (BOOL)installWithOptions:(nonnull SentryOptions *)options
self.scopeObserver =
[[SentryCrashScopeObserver alloc] initWithMaxBreadcrumbs:options.maxBreadcrumbs];

[self startCrashHandler:options.cacheDirectoryPath
BOOL enableSigtermReporting = NO;
#if !TARGET_OS_WATCH
enableSigtermReporting:options.enableSigtermReporting
enableSigtermReporting = options.enableSigtermReporting;
#endif // !TARGET_OS_WATCH
];

[self startCrashHandler:options.cacheDirectoryPath
enableSigtermReporting:enableSigtermReporting];

[self configureScope];

Expand All @@ -106,9 +108,7 @@ - (SentryIntegrationOption)integrationOptions
}

- (void)startCrashHandler:(NSString *)cacheDirectory
#if !TARGET_OS_WATCH
enableSigtermReporting:(BOOL)enableSigtermReporting
#endif // !TARGET_OS_WATCH
{
void (^block)(void) = ^{
BOOL canSendReports = NO;
Expand All @@ -125,9 +125,7 @@ - (void)startCrashHandler:(NSString *)cacheDirectory
canSendReports = YES;
}

#if !TARGET_OS_WATCH
sentrycrashcm_setEnableSigtermReporting(enableSigtermReporting);
#endif // !TARGET_OS_WATCH

[installation install:cacheDirectory];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
static volatile bool g_isEnabled = false;
static bool g_isSigtermReportingEnabled = false;

void
sentrycrashcm_setEnableSigtermReporting(bool enabled)
{
g_isSigtermReportingEnabled = enabled;
}

static SentryCrash_MonitorContext g_monitorContext;
static SentryCrashStackCursor g_stackCursor;

Expand Down Expand Up @@ -263,6 +257,14 @@ addContextualInfoToEvent(struct SentryCrash_MonitorContext *eventContext)

#endif

void
sentrycrashcm_setEnableSigtermReporting(bool enabled)
{
#if SentryCrashCRASH_HAS_SIGNAL
g_isSigtermReportingEnabled = enabled;
#endif
}

SentryCrashMonitorAPI *
sentrycrashcm_signal_getAPI(void)
{
Expand Down

0 comments on commit 918f61a

Please sign in to comment.