Skip to content

Commit

Permalink
Set background task to invalid if expiration handler runs.
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmoon committed Jul 28, 2015
1 parent 01a0efe commit c00132d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PINCache/PINDiskCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
__LINE__, [error localizedDescription]); }

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0 && !defined(PIN_APP_EXTENSIONS)
#define PINCacheStartBackgroundTask() UIBackgroundTaskIdentifier taskID = UIBackgroundTaskInvalid; \
#define PINCacheStartBackgroundTask() __block UIBackgroundTaskIdentifier taskID = UIBackgroundTaskInvalid; \
taskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ \
[[UIApplication sharedApplication] endBackgroundTask:taskID]; }];
[[UIApplication sharedApplication] endBackgroundTask:taskID]; taskID = UIBackgroundTaskInvalid; }];
#define PINCacheEndBackgroundTask() [[UIApplication sharedApplication] endBackgroundTask:taskID];
#else
#define PINCacheStartBackgroundTask()
Expand Down

0 comments on commit c00132d

Please sign in to comment.