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

jcesarmobile commented on CB-10745:
-----------------------------------

baseURL can be nil

loading an empty string is a way of "clearing" the webview

viewDidUnload was used to do a clean up of the viewcontroller and free memory 
when it was going to be destroyed or the device was low on memory, so, clearing 
the webview was a way of cleaning and reducing the memory. 

But according to the apple docs, viewDidUnload is never called on iOS 6+ 
because it was deprecated and we shouldn't need do the clean up when the 
viewcontroller view is destroyed

Anyway, loading the nil string doesn't make an app crash, I've tried. And 
loading an empty string won't fix his issue, because when viewDidUnload is 
called it's too late for him, the apps is already out of memory.

This issue is really strange as he says that it's happening even before opening 
the inAppBrowser, and that the problem is on a method that shouldn't be called 
on iOS 9.2.

Davide, can you provide the crash report?



> InAppBrowser application on iOS 9.2 / iPad 3 only
> -------------------------------------------------
>
>                 Key: CB-10745
>                 URL: https://issues.apache.org/jira/browse/CB-10745
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin InAppBrowser
>         Environment: iOS 9.2, iPad 3
>            Reporter: Davide
>            Assignee: jcesarmobile
>
> I'm starting to receive crash reports about users using an iPad 3 using iOS 
> 9.2. When I look into the crash reports I'm seeing the following in " 
> CDVInAppBrowser.m"
> - (void)viewDidUnload
> {
>     [self.webView loadHTMLString:nil baseURL:nil];
>     [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
>     [super viewDidUnload];
> }
> XCode is saying that "loadHTMLString"  "Null passed to a callee that requires 
> a non-null argument."
> And in the iOS documentation  
> https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/#//apple_ref/occ/instm/UIWebView/loadHTMLString:baseURL:
>  
> I'm not sure why this only occurs for one specific user on iPad 3 and I can't 
> seem to reproduce the problem in the simulator. 
> Question 1: How to fix?
> Question 2: According to the user the crash happens immidiately when starting 
> my cordova app before a button is pressed to open the inAppBrowser. When does 
> viewDidUnload get called? I have no experience with objective C. I'm making a 
> wild guess this is garbage collection for iOS.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to