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 (unknown [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9C5B18E46 for ; Fri, 29 May 2015 00:27:13 +0000 (UTC) Received: (qmail 17815 invoked by uid 500); 29 May 2015 00:26:58 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 17786 invoked by uid 500); 29 May 2015 00:26:58 -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 17775 invoked by uid 99); 29 May 2015 00:26:58 -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; Fri, 29 May 2015 00:26:58 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61815E10D1; Fri, 29 May 2015 00:26:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shazron@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ios commit: CB-8468 - Application freezes if breakpoint hits JavaScript callback invoked from native Date: Fri, 29 May 2015 00:26:48 +0000 (UTC) Repository: cordova-ios Updated Branches: refs/heads/4.0.x d75be3669 -> 81e3d6a4e CB-8468 - Application freezes if breakpoint hits JavaScript callback invoked from native Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/81e3d6a4 Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/81e3d6a4 Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/81e3d6a4 Branch: refs/heads/4.0.x Commit: 81e3d6a4eab29150a35c61313884aed7199c39e6 Parents: d75be36 Author: Shazron Abdullah Authored: Thu May 28 17:27:54 2015 -0700 Committer: Shazron Abdullah Committed: Thu May 28 17:27:54 2015 -0700 ---------------------------------------------------------------------- CordovaLib/Classes/Public/CDVCommandDelegateImpl.m | 7 ++++++- bin/templates/scripts/cordova/build-debug.xcconfig | 3 +++ cordova-js-src/exec.js | 12 ++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/81e3d6a4/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m b/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m index 6d168ab..a1c2c55 100644 --- a/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m +++ b/CordovaLib/Classes/Public/CDVCommandDelegateImpl.m @@ -137,8 +137,13 @@ int status = [result.status intValue]; BOOL keepCallback = [result.keepCallback boolValue]; NSString* argumentsAsJSON = [result argumentsAsJSON]; + BOOL debug = NO; + +#ifdef DEBUG + debug = YES; +#endif - NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d)", callbackId, status, argumentsAsJSON, keepCallback]; + NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d, %d)", callbackId, status, argumentsAsJSON, keepCallback, debug]; [self evalJsHelper:js]; } http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/81e3d6a4/bin/templates/scripts/cordova/build-debug.xcconfig ---------------------------------------------------------------------- diff --git a/bin/templates/scripts/cordova/build-debug.xcconfig b/bin/templates/scripts/cordova/build-debug.xcconfig index 124d020..3f11e59 100644 --- a/bin/templates/scripts/cordova/build-debug.xcconfig +++ b/bin/templates/scripts/cordova/build-debug.xcconfig @@ -22,4 +22,7 @@ // #include "build.xcconfig" + +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 + #include "build-extras.xcconfig" http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/81e3d6a4/cordova-js-src/exec.js ---------------------------------------------------------------------- diff --git a/cordova-js-src/exec.js b/cordova-js-src/exec.js index 856b9b1..7e7b17b 100644 --- a/cordova-js-src/exec.js +++ b/cordova-js-src/exec.js @@ -301,11 +301,19 @@ iOSExec.nativeFetchMessages = function() { return json; }; -iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) { +iOSExec.nativeCallback = function(callbackId, status, message, keepCallback, debug) { return iOSExec.nativeEvalAndFetch(function() { var success = status === 0 || status === 1; var args = convertMessageToArgsNativeToJs(message); - cordova.callbackFromNative(callbackId, success, status, args, keepCallback); + function nc2() { + cordova.callbackFromNative(callbackId, success, status, args, keepCallback); + }; + // CB-8468 + if (debug) { + setTimeout(nc2, 0); + } else { + nc2(); + } }); }; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org