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 626BD1991D for ; Sat, 9 Apr 2016 06:38:03 +0000 (UTC) Received: (qmail 76683 invoked by uid 500); 9 Apr 2016 06:38:03 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 76567 invoked by uid 500); 9 Apr 2016 06:38:03 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 76551 invoked by uid 99); 9 Apr 2016 06:38:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2016 06:38:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F069DDFA41; Sat, 9 Apr 2016 06:38:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: purplecabbage@apache.org To: commits@cordova.apache.org Date: Sat, 09 Apr 2016 06:38:04 -0000 Message-Id: <4029f924088b4c6381fe39e4d7974101@git.apache.org> In-Reply-To: <17ca68b4d0624f74b770ba137f98b757@git.apache.org> References: <17ca68b4d0624f74b770ba137f98b757@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] cordova-plugin-device git commit: Use passed device, follow create policy forf CFUUIDCreate Use passed device, follow create policy forf CFUUIDCreate Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/commit/5ec060ea Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/tree/5ec060ea Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/diff/5ec060ea Branch: refs/heads/master Commit: 5ec060eab4ce41f75be1e04a799da9c305d18081 Parents: 603c243 Author: Jesse MacFadyen Authored: Fri Apr 8 23:37:20 2016 -0700 Committer: Jesse MacFadyen Committed: Fri Apr 8 23:37:20 2016 -0700 ---------------------------------------------------------------------- src/ios/CDVDevice.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-device/blob/5ec060ea/src/ios/CDVDevice.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m index 7b05fc6..4d75a57 100644 --- a/src/ios/CDVDevice.m +++ b/src/ios/CDVDevice.m @@ -55,10 +55,12 @@ // which didn't user identifierForVendor NSString* app_uuid = [userDefaults stringForKey:UUID_KEY]; if (app_uuid == nil) { - if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) { + if ([device respondsToSelector:@selector(identifierForVendor)]) { app_uuid = [[device identifierForVendor] UUIDString]; } else { - app_uuid = (__bridge NSString *) CFUUIDCreateString(NULL, CFUUIDCreate(NULL)); + CFUUIDRef uuid = CFUUIDCreate(NULL); + app_uuid = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid); + CFRelease(uuid); } [userDefaults setObject:app_uuid forKey:UUID_KEY]; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org