Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2561DDBE1 for ; Thu, 5 Jul 2012 17:29:21 +0000 (UTC) Received: (qmail 24616 invoked by uid 500); 5 Jul 2012 17:29:21 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 24591 invoked by uid 500); 5 Jul 2012 17:29:21 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 24583 invoked by uid 99); 5 Jul 2012 17:29:21 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2012 17:29:21 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CBD34AF2B; Thu, 5 Jul 2012 17:29:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: shazron@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: ios commit: LocalStorage backup background task, set invalid when expired. Message-Id: <20120705172920.CBD34AF2B@tyr.zones.apache.org> Date: Thu, 5 Jul 2012 17:29:20 +0000 (UTC) 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 Wålm Authored: Tue Jul 3 14:54:03 2012 +0200 Committer: Shazron Abdullah 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