Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 067569545 for ; Fri, 30 Mar 2012 08:23:50 +0000 (UTC) Received: (qmail 58332 invoked by uid 500); 30 Mar 2012 08:23:49 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 57810 invoked by uid 500); 30 Mar 2012 08:23:44 -0000 Mailing-List: contact callback-dev-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-dev@incubator.apache.org Received: (qmail 57777 invoked by uid 99); 30 Mar 2012 08:23:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 08:23:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 08:23:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 36B7634E106 for ; Fri, 30 Mar 2012 08:23:22 +0000 (UTC) Date: Fri, 30 Mar 2012 08:23:22 +0000 (UTC) From: "Richard Kimber (Commented) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1452013439.37017.1333095802225.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <932206620.23079.1332854190945.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-391) navigator.camera.getPicture() crashing on iOS after memory warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CB-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13242153#comment-13242153 ] Richard Kimber commented on CB-391: ----------------------------------- I ran into the same issue and fixed by using the solution suggested by Jonathan Hobson: comment out [super didReceiveMemoryWarning] in didReceiveMemoryWarning. Here is the repo steps to hit this bug 100% on simulator: 1. Run your code in simulator, call up camera with navigator.camera.getPicture() to open the album (since camera is not available on simulator) 2. Simulator > Hardware > Simulate memory warning 3. Return from the iOS album (either click 'Cancel' or pick a photo) 4. Observe crash of the app This is because the [super didReceiveMemoryWarning] see the web view is running in background (while the album/camera is on) so released it. Later when the album/camera closes and tries to call the JS callback, it cannot find the JS handler and hence crash. Usually in object-c, it is ok to release background views and reconstruct later, just for PhoneGap the web view could not be removed as it is the root view and it has the JS callback to be used later. -- Yuankai (https://groups.google.com/d/msg/phonegap/ZLbw0s4JREs/Qnl0EwDZ6yMJ) > navigator.camera.getPicture() crashing on iOS after memory warning > ------------------------------------------------------------------ > > Key: CB-391 > URL: https://issues.apache.org/jira/browse/CB-391 > Project: Apache Callback > Issue Type: Bug > Components: iOS > Affects Versions: 1.5.0 > Environment: 2 x iPhone 4S, iOS 5.1. Can't replicate on simulator or iHone 3GS with iOS 5.0.1 > Reporter: Richard Kimber > Assignee: Shazron Abdullah > Attachments: Wulvern_2012-03-27-141033_Richs-iPhone.crash > > > getPicture has become very unstable on previously working code, affecting both Phonegap 1.4.1 and Cordova 1.5.0. Contributing factors, since last working build I have upgraded Xcode to 4.3.2 (from whatever the last version was) and iPhone to iOS 5.1 from 5.0.1. > Memory warning is received on displaying camera, app crashes when you select 'use'. Restarting device usually resolves problem for a limited amount of time. Problem is intermittent and sometime difficult to replicate. Selecting from Photo library works fine. > Options used: > var options = { > quality: 40, > sourceType: Camera.DestinationType.FILE_URI > }; > See https://groups.google.com/forum/?hl=en?hl%3Den&fromgroups#!topic/phonegap/ZLbw0s4JREs for more details. > See attached for example crash log. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira