Updated Branches: refs/heads/master 2dae04085 -> 49d6f8215
LocalStorage backup background task, set invalid when expired. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/49d6f821 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/49d6f821 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/49d6f821 Branch: refs/heads/master Commit: 49d6f821580ec315b72616a0a2a640f9e322f839 Parents: 2dae040 Author: Andreas WaÌlm <andr...@walm.net> Authored: Tue Jul 3 14:54:03 2012 +0200 Committer: Shazron Abdullah <shaz...@apache.org> Committed: Thu Jul 5 10:29:04 2012 -0700 ---------------------------------------------------------------------- CordovaLib/Classes/CDVLocalStorage.m | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/49d6f821/CordovaLib/Classes/CDVLocalStorage.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVLocalStorage.m b/CordovaLib/Classes/CDVLocalStorage.m index 4d466ff..70682ee 100644 --- a/CordovaLib/Classes/CDVLocalStorage.m +++ b/CordovaLib/Classes/CDVLocalStorage.m @@ -298,6 +298,8 @@ __block UIBackgroundTaskIdentifier backgroundTaskID = UIBackgroundTaskInvalid; backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ + [[UIApplication sharedApplication] endBackgroundTask: backgroundTaskID]; + backgroundTaskID = UIBackgroundTaskInvalid; NSLog(@"Background task to backup WebSQL/LocalStorage expired."); }]; @@ -425,4 +427,4 @@ return [self item:self.backup isNewerThanItem:self.original]; } -@end \ No newline at end of file +@end