Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Fix crash in extensions #499

Merged

Conversation

bmourat
Copy link
Contributor

@bmourat bmourat commented Dec 15, 2017

@@ -1053,7 +1054,7 @@ - (void)triggerDelayedProcessing {
*/
- (void)invokeDelayedProcessing {
#if !defined (HOCKEYSDK_CONFIGURATION_ReleaseCrashOnlyExtensions)
if ([BITHockeyHelper applicationState] != BITApplicationStateActive) {
if (!bit_isRunningInAppExtension() && [BITHockeyHelper applicationState] != BITApplicationStateActive) {
Copy link
Contributor

@ElektrojungeAtWork ElektrojungeAtWork Dec 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary? [BITHockeyHelper applicationState] contains checks if it runs in an app extension.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applicationState returns BITApplicationStateUnknown if running in extension and thus returning from this immediately and preventing from processing crashes


- [BUGFIX] Fixes a critical bug that would cause apps to freeze when calling `trackEvent` in UIApplicationDelegate callbacks. [#492](https://github.com/bitstadium/HockeySDK-iOS/pull/493)
- [BUGFIX] Fix a critical bug in the crashonly variant of the SDK. [#49](https://github.com/bitstadium/HockeySDK-iOS/pull/494)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's really odd that this is displayed as a change while it's already in develop.

@@ -556,6 +556,7 @@ - (void) registerObservers {
self.didLogLowMemoryWarning = YES;
}
});
dispatch_resume(source);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we need that here. Can you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this because dispatch_source_create creates source in a suspended state and we must call at some point after creation dispatch_resume. https://developer.apple.com/documentation/dispatch/1385630-dispatch_source_create?language=objc

@ElektrojungeAtWork ElektrojungeAtWork merged commit 7a58aea into bitstadium:develop Dec 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants