Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D09F510849 for ; Mon, 28 Oct 2013 22:11:39 +0000 (UTC) Received: (qmail 81259 invoked by uid 500); 28 Oct 2013 22:11:39 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 81201 invoked by uid 500); 28 Oct 2013 22:11:39 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 81085 invoked by uid 99); 28 Oct 2013 22:11:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Oct 2013 22:11:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0DC74886E12; Mon, 28 Oct 2013 22:11:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: steven@apache.org To: commits@cordova.apache.org Date: Mon, 28 Oct 2013 22:11:43 -0000 Message-Id: In-Reply-To: <4e7a389715ba41958889543b1ded8ee6@git.apache.org> References: <4e7a389715ba41958889543b1ded8ee6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/19] git commit: [CB-4825] avoid retain cycle in update block [CB-4825] avoid retain cycle in update block Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/commit/b2e17a78 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/tree/b2e17a78 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/diff/b2e17a78 Branch: refs/heads/master Commit: b2e17a784a6d69a89410e661f3f9d76f0fcb4bc5 Parents: ea30406 Author: James Jong Authored: Wed Oct 2 16:21:49 2013 -0400 Committer: James Jong Committed: Wed Oct 2 16:21:49 2013 -0400 ---------------------------------------------------------------------- src/ios/CDVAccelerometer.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-motion/blob/b2e17a78/src/ios/CDVAccelerometer.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVAccelerometer.m b/src/ios/CDVAccelerometer.m index b338245..20bcbc6 100755 --- a/src/ios/CDVAccelerometer.m +++ b/src/ios/CDVAccelerometer.m @@ -66,12 +66,13 @@ if ([self.motionManager isAccelerometerAvailable] == YES) { // Assign the update interval to the motion manager and start updates [self.motionManager setAccelerometerUpdateInterval:kAccelerometerInterval/1000]; // expected in seconds + __weak CDVAccelerometer* weakSelf = self; [self.motionManager startAccelerometerUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) { x = accelerometerData.acceleration.x; y = accelerometerData.acceleration.y; z = accelerometerData.acceleration.z; timestamp = ([[NSDate date] timeIntervalSince1970] * 1000); - [self returnAccelInfo]; + [weakSelf returnAccelInfo]; }]; if (!self.isRunning) {