[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16379784#comment-16379784
 ] 

ASF GitHub Bot commented on CB-13382:
-

shazron closed pull request #359: CB-13382 dealloc the webViewEngine
URL: https://github.com/apache/cordova-ios/pull/359
 
 
   

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):

diff --git a/CordovaLib/Classes/Public/CDVViewController.m 
b/CordovaLib/Classes/Public/CDVViewController.m
index f34b3ddf5..081c9162b 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -782,6 +782,11 @@ - (void)dealloc
 [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
 [_commandQueue dispose];
 [[self.pluginObjects allValues] 
makeObjectsPerformSelector:@selector(dispose)];
+
+[self.webViewEngine loadHTMLString:@"about:blank" baseURL:nil];
+[self.pluginObjects removeAllObjects];
+[self.webView removeFromSuperview];
+self.webViewEngine = nil;
 }
 
 - (NSInteger*)userAgentLockToken


 


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:
us...@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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16379786#comment-16379786
 ] 

ASF subversion and git services commented on CB-13382:
--

Commit e75c38f65d05b8bbca1178d6ace309a2df7844da in cordova-ios's branch 
refs/heads/master from [~surajpindoria]
[ https://gitbox.apache.org/repos/asf?p=cordova-ios.git;h=e75c38f ]

CB-13382 dealloc the webViewEngine (#359)

* CB-13382: (ios) Added destroyWebView method for CDVViewController

* CB-13382: (ios) Remove new function and add to delloc method


> 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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16379787#comment-16379787
 ] 

ASF subversion and git services commented on CB-13382:
--

Commit e75c38f65d05b8bbca1178d6ace309a2df7844da in cordova-ios's branch 
refs/heads/master from [~surajpindoria]
[ https://gitbox.apache.org/repos/asf?p=cordova-ios.git;h=e75c38f ]

CB-13382 dealloc the webViewEngine (#359)

* CB-13382: (ios) Added destroyWebView method for CDVViewController

* CB-13382: (ios) Remove new function and add to delloc method


> 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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16379785#comment-16379785
 ] 

ASF subversion and git services commented on CB-13382:
--

Commit e75c38f65d05b8bbca1178d6ace309a2df7844da in cordova-ios's branch 
refs/heads/master from [~surajpindoria]
[ https://gitbox.apache.org/repos/asf?p=cordova-ios.git;h=e75c38f ]

CB-13382 dealloc the webViewEngine (#359)

* CB-13382: (ios) Added destroyWebView method for CDVViewController

* CB-13382: (ios) Remove new function and add to delloc method


> 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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16379459#comment-16379459
 ] 

ASF GitHub Bot commented on CB-13382:
-

codecov-io commented on issue #359: CB-13382 dealloc the webViewEngine
URL: https://github.com/apache/cordova-ios/pull/359#issuecomment-369060697
 
 
   # [Codecov](https://codecov.io/gh/apache/cordova-ios/pull/359?src=pr=h1) 
Report
   > Merging 
[#359](https://codecov.io/gh/apache/cordova-ios/pull/359?src=pr=desc) into 
[master](https://codecov.io/gh/apache/cordova-ios/commit/28e7ac1474163c8a43e6adf5474da6298a4e0afa?src=pr=desc)
 will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/cordova-ios/pull/359/graphs/tree.svg?token=WomDD5jInz=pr=150=650)](https://codecov.io/gh/apache/cordova-ios/pull/359?src=pr=tree)
   
   ```diff
   @@   Coverage Diff   @@
   ##   master #359   +/-   ##
   ===
 Coverage   63.99%   63.99%   
   ===
 Files  14   14   
 Lines1697 1697   
 Branches  286  286   
   ===
 Hits 1086 1086   
 Misses611  611
   ```
   
   
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/cordova-ios/pull/359?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/cordova-ios/pull/359?src=pr=footer). 
Last update 
[28e7ac1...9307034](https://codecov.io/gh/apache/cordova-ios/pull/359?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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:
us...@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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16379438#comment-16379438
 ] 

ASF GitHub Bot commented on CB-13382:
-

surajpindoria opened a new pull request #359: CB-13382 dealloc the webViewEngine
URL: https://github.com/apache/cordova-ios/pull/359
 
 
   
   
   ### Platforms affected
   iOS
   
   ### What does this PR do?
   Adds an additional clean up step to dealloc
   
   ### What testing has been done on this change?
   
   
   ### Checklist
   - [ ] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
   - [ ] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB- is the JIRA ID & "android" is the platform 
affected.
   - [ ] Added automated test coverage as appropriate for this change.
   


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:
us...@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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-02-27 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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:
us...@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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2018-01-18 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16330231#comment-16330231
 ] 

ASF GitHub Bot commented on CB-13382:
-

shazron commented on a change in pull request #342: CB-13382: (ios) Added 
destroyWebView method for CDVViewController
URL: https://github.com/apache/cordova-ios/pull/342#discussion_r162273382
 
 

 ##
 File path: CordovaLib/Classes/Public/CDVViewController.m
 ##
 @@ -767,13 +767,23 @@ - 
(void)onAppDidEnterBackground:(NSNotification*)notification
 
 // ///
 
+- (void)destroyWebView
+{
+self.webViewEngine = nil;
 
 Review comment:
   Woops I forgot about the dealloc in there since I haven't thought about it 
since everything is ARC. I think that we should just put `self.webviewEngine = 
nil` in the `dealloc` method, that would free it up I think.


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:
us...@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:///x/myApp/www/index.html becomes file:///x/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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2017-11-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16234232#comment-16234232
 ] 

ASF GitHub Bot commented on CB-13382:
-

jcesarmobile commented on a change in pull request #342: CB-13382: (ios) Added 
destroyWebView method for CDVViewController
URL: https://github.com/apache/cordova-ios/pull/342#discussion_r148295633
 
 

 ##
 File path: CordovaLib/Classes/Public/CDVViewController.m
 ##
 @@ -767,13 +767,23 @@ - 
(void)onAppDidEnterBackground:(NSNotification*)notification
 
 // ///
 
+- (void)destroyWebView
+{
+self.webViewEngine = nil;
 
 Review comment:
   I think this won't do anything if we don't call all what you put on the 
dealloc. If we are going to offer this new method, it should do everything what 
is on the dealloc and dealloc just call it. 
   
   Anyway, the main problem of CB-13382 is that dealloc is not doing the 
complete cleanup of the webview, with the new code it will do it, so we don't 
really need to offer this new method as dealloc will do the cleaning 
automatically.


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:
us...@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:///x/myApp/www/index.html becomes file:///x/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
(v6.4.14#64029)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-13382) Cordova iOS - Method to correctly destroy CDVViewControllers webView object

2017-10-06 Thread Suraj Pindoria (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-13382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16194985#comment-16194985
 ] 

Suraj Pindoria commented on CB-13382:
-

Submitted PR for this: https://github.com/apache/cordova-ios/pull/342

> 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:///x/myApp/www/index.html becomes file:///x/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
(v6.4.14#64029)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org