Skip to content

Commit d88dedf

Browse files
author
Edward Smith
committed
Fixed text.
1 parent a5e5a20 commit d88dedf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Branch-SDK/Branch-SDK/Networking/BNCServerRequestQueue.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ - (id)init {
4242
}
4343

4444
- (void) dealloc {
45+
if (self.persistTimer)
46+
dispatch_source_cancel(self.persistTimer);
4547
[self persistImmediately];
4648
}
4749

@@ -237,7 +239,7 @@ - (void)persistEventually {
237239
);
238240
__weak __typeof(self) weakSelf = self;
239241
dispatch_source_set_event_handler(self.persistTimer, ^ {
240-
__strong __typeof(self) strongSelf = weakSelf;
242+
__strong __typeof(weakSelf) strongSelf = weakSelf;
241243
if (strongSelf) {
242244
[strongSelf persistImmediately];
243245
dispatch_source_cancel(strongSelf.persistTimer);
@@ -250,8 +252,9 @@ - (void)persistEventually {
250252

251253
- (void)persistImmediately {
252254
@synchronized (self) {
253-
NSArray *requestsToPersist = [self.queue copy];
254255
@try {
256+
if (!self.queue) return;
257+
NSArray *requestsToPersist = [self.queue copy];
255258
NSMutableArray *encodedRequests = [[NSMutableArray alloc] init];
256259
for (BNCServerRequest *req in requestsToPersist) {
257260
// Don't persist these requests

0 commit comments

Comments
 (0)