From issues-return-93039-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Tue Feb 27 23:56:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9DA8E180671 for ; Tue, 27 Feb 2018 23:56:07 +0100 (CET) Received: (qmail 56376 invoked by uid 500); 27 Feb 2018 22:56:06 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 56299 invoked by uid 99); 27 Feb 2018 22:56:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Feb 2018 22:56:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 1F05EC1B5C for ; Tue, 27 Feb 2018 22:56:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pt6D9kk3BOGx for ; Tue, 27 Feb 2018 22:56:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AEE115F568 for ; Tue, 27 Feb 2018 22:56:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 74F7FE01DA for ; Tue, 27 Feb 2018 22:56:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id BD7FE2410E for ; Tue, 27 Feb 2018 22:56:00 +0000 (UTC) Date: Tue, 27 Feb 2018 22:56:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16379429#comment-16379429 ] ASF GitHub Bot commented on CB-13382: ------------------------------------- surajpindoria closed pull request #342: CB-13382: (ios) Added destroyWebView method for CDVViewController URL: https://github.com/apache/cordova-ios/pull/342 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org > Cordova iOS - Method to correctly destroy CDVViewControllers webView object > --------------------------------------------------------------------------- > > Key: CB-13382 > URL: https://issues.apache.org/jira/browse/CB-13382 > Project: Apache Cordova > Issue Type: Improvement > Components: cordova-ios > Affects Versions: cordova-ios 4.5.0 > Reporter: Nick Deakin > Assignee: Suraj Pindoria > Priority: Minor > > We have an app where we are using multi CDVViewController instances where a user can switch between hybrid apps within the native app. > The issue that as been lingering for a couple of years is that even though a CDVViewController instance can be set to nil, the webview contained within still remains in memory. This can be observed when using the safari debugger. > This is particularly troublesome when the webview is 'closed', then the content files in the webview are updated, and finally the webview is recreated, showing the old content. Performing a cmd-r in safari debugger refreshes the view and shows the updated content. > We can also do this a [UIWebView reload], but it is not possible if the app changes it's URL to a none physical path, e.g. file:///xxxxx/myApp/www/index.html becomes file:///xxxxx/myApp/www/home, then we get a page load error. > I've been able to get the webview completely removed by doing the following: > add the following method to CDVViewController: > {code:java} > -(void)destroyWebView { > self.webViewEngine = nil; > } > {code} > then in my view controllers destroy method: > {code:java} > [self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil]; > [self.pluginObjects removeAllObjects]; > [self.webView removeFromSuperview]; > [self destroyWebView]; > {code} > Setting webViewEngine to nil is an unavoidable step to completely destroying the webview, but it is readonly. > Therefore, i would really appreciate this destroyWebView method, or a similar cleanup method being added. > Android has a method to clean up which is CordovaWebViewImpl.handleDestroy(). > This destroys all the plugins, sets the URL to 'about:blank' and then executes engine.destroy() > Many thanks! > Nick -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org