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

Commit 323df90

Browse files
author
Benjamin Scholtysik (Reimold)
authored
Merge pull request #505 from bitstadium/develop
develop -> master
2 parents f882fa8 + 055f2e9 commit 323df90

16 files changed

+88
-42
lines changed

Classes/BITChannel.m

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#import "BITDevice.h"
1515
#import "BITPersistencePrivate.h"
1616
#import "BITSender.h"
17-
#import <libkern/OSAtomic.h>
17+
#import <stdatomic.h>
1818

1919

2020
static char *const BITDataItemsOperationsQueue = "net.hockeyapp.senderQueue";
@@ -29,6 +29,8 @@
2929
static NSInteger const BITDebugMaxBatchSize = 5;
3030
static NSInteger const BITDebugBatchInterval = 3;
3131

32+
typedef _Atomic(char*) atomic_charptr;
33+
3234
NS_ASSUME_NONNULL_BEGIN
3335

3436
@interface BITChannel ()
@@ -131,13 +133,12 @@ - (void)persistDataItemQueue:(char **)eventBuffer {
131133

132134
// Make sure string (which points to BITTelemetryEventBuffer) is not changed.
133135
char *previousBuffer = NULL;
134-
char *newEmptyString = NULL;
136+
char *newEmptyString = strdup("");
135137
do {
136-
newEmptyString = strdup("");
137138
previousBuffer = *eventBuffer;
138139

139140
// This swaps pointers and makes sure eventBuffer now has the balue of newEmptyString.
140-
if (OSAtomicCompareAndSwapPtr(previousBuffer, newEmptyString, (void*)eventBuffer)) {
141+
if (atomic_compare_exchange_strong((atomic_charptr *)eventBuffer, &previousBuffer, newEmptyString)) {
141142
@synchronized(self) {
142143
self.dataItemCount = 0;
143144
}
@@ -403,7 +404,7 @@ void bit_appendStringToEventBuffer(NSString *string, char **eventBuffer) {
403404
asprintf(&newBuffer, "%s%.*s\n", previousBuffer, (int)MIN(string.length, (NSUInteger)INT_MAX), string.UTF8String);
404405

405406
// Compare newBuffer and previousBuffer. If they point to the same address, we are safe to use them.
406-
if (OSAtomicCompareAndSwapPtr(previousBuffer, newBuffer, (void*)eventBuffer)) {
407+
if (atomic_compare_exchange_strong((atomic_charptr *)eventBuffer, &previousBuffer, newBuffer)) {
407408

408409
// Free the intermediate pointer.
409410
free(previousBuffer);
@@ -417,16 +418,17 @@ void bit_appendStringToEventBuffer(NSString *string, char **eventBuffer) {
417418
}
418419

419420
void bit_resetEventBuffer(char **eventBuffer) {
420-
if (!eventBuffer) { return; }
421+
if (!eventBuffer) {
422+
return;
423+
}
421424

422-
char *newEmptyString = NULL;
423425
char *prevString = NULL;
426+
char *newEmptyString = strdup("");
424427
do {
425428
prevString = *eventBuffer;
426-
newEmptyString = strdup("");
427429

428430
// Compare pointers to strings to make sure we are still threadsafe!
429-
if (OSAtomicCompareAndSwapPtr(prevString, newEmptyString, (void*)eventBuffer)) {
431+
if (atomic_compare_exchange_strong((atomic_charptr *)eventBuffer, &prevString, newEmptyString)) {
430432
free(prevString);
431433
return;
432434
}

Classes/BITCrashManager.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ - (void) registerObservers {
556556
self.didLogLowMemoryWarning = YES;
557557
}
558558
});
559+
dispatch_resume(source);
559560
});
560561
} else {
561562
self.appDidReceiveLowMemoryWarningObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification
@@ -1053,7 +1054,7 @@ - (void)triggerDelayedProcessing {
10531054
*/
10541055
- (void)invokeDelayedProcessing {
10551056
#if !defined (HOCKEYSDK_CONFIGURATION_ReleaseCrashOnlyExtensions)
1056-
if ([BITHockeyHelper applicationState] != BITApplicationStateActive) {
1057+
if (!bit_isRunningInAppExtension() && [BITHockeyHelper applicationState] != BITApplicationStateActive) {
10571058
return;
10581059
}
10591060
#endif

Classes/BITFeedbackComposeViewController.m

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,7 @@ - (void)keyboardWasShown:(NSNotification*)aNotification {
155155

156156
CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
157157
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
158-
if (isPortraitOrientation) {
159-
frame.size.height -= kbSize.height;
160-
} else {
161-
frame.size.height -= kbSize.width;
162-
}
158+
frame.size.height -= kbSize.height;
163159
} else {
164160
CGSize windowSize = [[UIScreen mainScreen] bounds].size;
165161
CGFloat windowHeight = windowSize.height - 20;
@@ -168,20 +164,19 @@ - (void)keyboardWasShown:(NSNotification*)aNotification {
168164
if (isPortraitOrientation) {
169165
frame.size.height = windowHeight - navBarHeight - kbSize.height;
170166
} else {
171-
windowHeight = windowSize.width - 20;
167+
windowHeight = windowSize.height - 20;
172168
CGFloat modalGap = 0.0;
173-
if (windowHeight - kbSize.width < self.view.bounds.size.height) {
169+
if (windowHeight - kbSize.height < self.view.bounds.size.height) {
174170
modalGap = 30;
175171
} else {
176172
modalGap = (windowHeight - self.view.bounds.size.height) / 2;
177173
}
178-
frame.size.height = windowSize.width - navBarHeight - modalGap - kbSize.width;
174+
frame.size.height = windowSize.height - navBarHeight - modalGap - kbSize.height;
179175
}
180176
}
181177
[self.contentViewContainer setFrame:frame];
182178

183179
[self performSelector:@selector(refreshAttachmentScrollview) withObject:nil afterDelay:0.0];
184-
185180
}
186181

187182
- (void)keyboardWillBeHidden:(NSNotification*) __unused aNotification {

Documentation/Guides/Changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 5.1.2
2+
3+
- [IMPROVEMENT] This release uses Xcode 9.2 to compile the SDK. [#502](https://github.com/bitstadium/HockeySDK-iOS/pull/503)
4+
- [BUGFIX] Fix warnings when integrating the SDK as source in Xcode 9. [#501](https://github.com/bitstadium/HockeySDK-iOS/pull/501)
5+
- [BUGFIX] Fix a potential memory leak in `BITChannel`. [#500](https://github.com/bitstadium/HockeySDK-iOS/pull/500)
6+
- [BUGFIX] Version 5.1.X broke support for app extension. We're sorry about this and we've updated our test matrix to make sure this does not happen again. [#499](https://github.com/bitstadium/HockeySDK-iOS/pull/499)
7+
- [BUGFIX] Fix a bug in the Feedback UI when Feedback was shown in landscape. [#498](https://github.com/bitstadium/HockeySDK-iOS/pull/498)
8+
19
## 5.1.1
210

311
- [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)

Documentation/Guides/Installation & Setup.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK)
44
[![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net)
55

6-
## Version 5.1.1
6+
## Version 5.1.2
77

8-
- [Changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.1/docs/docs/Changelog.html)
8+
- [Changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.2/docs/docs/Changelog.html)
99

1010
**NOTE** If your are using the binary integration of our SDK, make sure that the `HockeySDKResources.bundle` inside the `HockeySDK.embeddedframework`-folder has been added to your application.
1111

@@ -821,7 +821,7 @@ To check if data is send properly to HockeyApp and also see some additional SDK
821821
<a id="documentation"></a>
822822
## 4. Documentation
823823
824-
Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/5.1.1/index.html).
824+
Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/5.1.2/index.html).
825825
826826
<a id="troubleshooting"></a>
827827
## 5.Troubleshooting
@@ -835,7 +835,7 @@ Our documentation can be found on [HockeyApp](http://hockeyapp.net/help/sdk/ios/
835835
Make sure none of the following files are copied into your app bundle, check under app target, `Build Phases`, `Copy Bundle Resources` or in the `.app` bundle after building:
836836
837837
- `HockeySDK.framework` (except if you build a dynamic framework version of the SDK yourself!)
838-
- `de.bitstadium.HockeySDK-iOS-5.1.1.docset`
838+
- `de.bitstadium.HockeySDK-iOS-5.1.2.docset`
839839
840840
### Features are not working as expected
841841

Documentation/HockeySDK/.jazzy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sdk: iphonesimulator
55
theme: ../Themes/apple
66

77
module: HockeySDK
8-
module_version: 5.1.1
8+
module_version: 5.1.2
99
author: Microsoft Corp
1010
author_url: https://www.microsoft.com
1111

HockeySDK-Source.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'HockeySDK-Source'
3-
s.version = '5.1.1'
3+
s.version = '5.1.2'
44

55
s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.'
66
s.description = <<-DESC
@@ -25,7 +25,7 @@ Pod::Spec.new do |s|
2525
s.frameworks = 'CoreGraphics', 'CoreTelephony', 'CoreText', 'MobileCoreServices', 'Photos', 'QuartzCore', 'QuickLook', 'Security', 'SystemConfiguration', 'UIKit'
2626
s.libraries = 'c++', 'z'
2727
s.vendored_frameworks = 'Vendor/CrashReporter.framework'
28-
s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"107\\"" BITHOCKEY_C_BUILD="\\"107\\""} }
28+
s.pod_target_xcconfig = {'GCC_PREPROCESSOR_DEFINITIONS' => %{$(inherited) BITHOCKEY_VERSION="@\\"#{s.version}\\"" BITHOCKEY_C_VERSION="\\"#{s.version}\\"" BITHOCKEY_BUILD="@\\"108\\"" BITHOCKEY_C_BUILD="\\"108\\""} }
2929
s.resource_bundle = { 'HockeySDKResources' => ['Resources/*.png', 'Resources/*.lproj'] }
3030
s.preserve_paths = 'Resources', 'Support'
3131
s.private_header_files = 'Classes/*Private.h'

HockeySDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'HockeySDK'
3-
s.version = '5.1.1'
3+
s.version = '5.1.2'
44

55
s.summary = 'Collect live crash reports, get feedback from your users, distribute your betas, and analyze your test coverage with HockeyApp.'
66
s.description = <<-DESC

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Version](http://cocoapod-badges.herokuapp.com/v/HockeySDK/badge.png)](http://cocoadocs.org/docsets/HockeySDK)
44
[![Slack Status](https://slack.hockeyapp.net/badge.svg)](https://slack.hockeyapp.net)
55

6-
## Version 5.1.1
6+
## Version 5.1.2
77

88
HockeySDK-iOS implements support for using HockeyApp in your iOS applications.
99

@@ -23,13 +23,13 @@ The following features are currently supported:
2323

2424
## 1. Setup
2525

26-
It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation](https://www.hockeyapp.net/help/sdk/ios/5.1.1/index.html) and onboard your app within minutes.
26+
It is super easy to use HockeyApp in your iOS app. Have a look at our [documentation](https://www.hockeyapp.net/help/sdk/ios/5.1.2/index.html) and onboard your app within minutes.
2727

2828
## 2. Documentation
2929

30-
Please visit [our landing page](https://www.hockeyapp.net/help/sdk/ios/5.1.1/index.html) as a starting point for all of our documentation.
30+
Please visit [our landing page](https://www.hockeyapp.net/help/sdk/ios/5.1.2/index.html) as a starting point for all of our documentation.
3131

32-
Please check out our [changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.1/changelog.html), as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.1/installation--setup.html#troubleshooting).
32+
Please check out our [changelog](http://www.hockeyapp.net/help/sdk/ios/5.1.2/changelog.html), as well as our [troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.2/installation--setup.html#troubleshooting).
3333

3434
## 3. Contributing
3535

@@ -53,4 +53,4 @@ You must sign a [Contributor License Agreement](https://cla.microsoft.com/) befo
5353

5454
## 4. Contact
5555

56-
If you have further questions or are running into trouble that cannot be resolved by any of the steps [in our troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.1/installation--setup.html#troubleshooting), feel free to open an issue here, contact us at [[email protected]](mailto:[email protected]) or join our [Slack](https://slack.hockeyapp.net).
56+
If you have further questions or are running into trouble that cannot be resolved by any of the steps [in our troubleshooting section](https://www.hockeyapp.net/help/sdk/ios/5.1.2/installation--setup.html#troubleshooting), feel free to open an issue here, contact us at [[email protected]](mailto:[email protected]) or join our [Slack](https://slack.hockeyapp.net).

0 commit comments

Comments
 (0)