a crash when exiting an overlay scene with a webView (only happens in iOS device testing)

Rob, can you kindly confirm whether we need a bug report for the bug you were not able to duplicate but Brent managed to later on? Since in 2100 it does not seem to crash in this manner I see this as a regression bug. CL sample code is where it’s seen so a bug report at this point seems like unnecessary work to me. Regression bugs should take priority right? Thanks

That bug has been filed.

Rob

Love it when you say that! :) 

Thank you very much!

So happy there’s been some traction with this issue.

@Brent: I can confirm iPod Touch 4g with iOS 6.x as well (iOS7 not possible, as you stated). I have an iPad mini (non-retina) and iPhone 5 that also have the same issue.

Thanks for the detailed response.

If it is the way it is & nothing can be done, I have to say Corona webView provides basic functionalities only. And my conclusion is that apps that really use & depend embedded browsers a lot, like a news reader app, should not be built with Corona. I think I have to go with XCode if I want to put my news reader app into another level. I will use Corona for games only or business apps that don’t require an advanced embedded browser at all.

Take a look at modern news apps like Flipboard & recently-launched Facebook Paper, their embedded browsers are where the trend is going. I had hoped I could do something similar with Corona for the embedded browser.

Is this fixed? My webview crash sometimes when I trying to remove the webview before the web has been completely loaded on iOS 7.

I am using Corona Build 2014.2152 and I had this problem on iPad 3 iOS 7.0.4.

@boscotwcheung, This has not been fixed yet.

Daily build 2174 seems having fixed this issue?

  • iOS/Mac: Resolving issue when closing/removing WebView from scene casenum:25975, 28771, 27995, 28729

If you have the issue (I can’t reproduce it somehow), maybe you want to verify it… & post some result here… would like to know if everything goes better for webView.

Thanks.

It works for me using daily build 2174

No crashes using Daily Build 2174, yeah and thanks!

I’ve just found that we are still having the same issue, I’m currently using build 2182 (I would update it but with any luck we will be releasing soon so I’d rather not risk an update breaking something).

Although we do use storyboard, I’m calling the webview as a sort of overlay to the scene. I have 2 buttons, one which calls the webview, and another which dismisses it and calls up some other stuff.

At the point where I remove the “overlay”, I call the following:

if webView then webView:stop() webView:removeSelf() webView = nil end 

I don’t call webView:removeEventListener( “urlRequest”, webListener ) at the moment because I also don’t add any listener to it (I did before, but it was just this and so had no real use:

local function webListener( event ) if event.url then print( "You are visiting: " .. event.url ) end if event.type then print( "The event.type is " .. event.type ) -- print the type of request end if event.errorCode then native.showAlert( "Error!", event.errorMessage, { "OK" } ) end end 

If I press my callWebview button, and then quickly press the dismiss button I get a seg11 fault. This is on an iPad 3, it never happens on Android. It’s clearly a similar problem to the one mentioned before, the webView:request function is receiving it’s reply after the webview has been dismissed, but shouldn’t webview:stop() pick that up?

Now using SDK 2014.2260 and we are still getting the same problem. I’ve added the urlRequest listener back in, and removed it when I remove the webview:

if webView then webView:stop() webView:removeEventListener( "urlRequest", webListener ) webView:removeSelf() webView = nil end

but still we end up with a segmentation fault if we open and close it quickly.

Can you produce a small app that demos the problem still?  This is the first set of complaints about this in a while.

I’ve just found that we are still having the same issue, I’m currently using build 2182 (I would update it but with any luck we will be releasing soon so I’d rather not risk an update breaking something).

Although we do use storyboard, I’m calling the webview as a sort of overlay to the scene. I have 2 buttons, one which calls the webview, and another which dismisses it and calls up some other stuff.

At the point where I remove the “overlay”, I call the following:

if webView then webView:stop() webView:removeSelf() webView = nil end 

I don’t call webView:removeEventListener( “urlRequest”, webListener ) at the moment because I also don’t add any listener to it (I did before, but it was just this and so had no real use:

local function webListener( event ) if event.url then print( "You are visiting: " .. event.url ) end if event.type then print( "The event.type is " .. event.type ) -- print the type of request end if event.errorCode then native.showAlert( "Error!", event.errorMessage, { "OK" } ) end end 

If I press my callWebview button, and then quickly press the dismiss button I get a seg11 fault. This is on an iPad 3, it never happens on Android. It’s clearly a similar problem to the one mentioned before, the webView:request function is receiving it’s reply after the webview has been dismissed, but shouldn’t webview:stop() pick that up?

Now using SDK 2014.2260 and we are still getting the same problem. I’ve added the urlRequest listener back in, and removed it when I remove the webview:

if webView then webView:stop() webView:removeEventListener( "urlRequest", webListener ) webView:removeSelf() webView = nil end

but still we end up with a segmentation fault if we open and close it quickly.

Can you produce a small app that demos the problem still?  This is the first set of complaints about this in a while.

We’re still seeing this same issue where a removed webview causes segmentation fault crashes.  

In my case, our game supports all orientations. We have a pull down menu which contains a webview, and when the game rotates we remove this menu+webview and redraw them as a different size to better fit the screen. 

If the webview has not finished loading, it almost always causes a crash (it’s hard to tell how often because the webview is sometimes off screen).

It seems that:

webView:stop() webView:removeEventListener( "urlRequest", webListener )

have no effect if a request is still incoming.

We’ve just had to retract a submission to apple because we spotted this after submitting, and we’re trying to come up with a suitable workaround. So while I would like to make a sample app, I’m not sure I can right now. 

I’m using daily build 2014.2432, which is only a few days old.

Can you file a bug report?  We think this was fixed, and if its not working, Engineering will need something to go on.

Rob

We’re still seeing this same issue where a removed webview causes segmentation fault crashes.  

In my case, our game supports all orientations. We have a pull down menu which contains a webview, and when the game rotates we remove this menu+webview and redraw them as a different size to better fit the screen. 

If the webview has not finished loading, it almost always causes a crash (it’s hard to tell how often because the webview is sometimes off screen).

It seems that:

webView:stop() webView:removeEventListener( "urlRequest", webListener )

have no effect if a request is still incoming.

We’ve just had to retract a submission to apple because we spotted this after submitting, and we’re trying to come up with a suitable workaround. So while I would like to make a sample app, I’m not sure I can right now. 

I’m using daily build 2014.2432, which is only a few days old.

Can you file a bug report?  We think this was fixed, and if its not working, Engineering will need something to go on.

Rob