Project: titanium
Issue TIMOB-20161: Windows: Webview not cleaned up when parent window closed
When running the webview unit tests locally, specifically the test that loads appcelerator.com, I am seeing some troubling output. Even after the test finishes and passes, the output is spamming with: {code} Exception thrown at 0x76F92ED2 in NMocha.exe: Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x054FF02C. Invalid parameter passed to C runtime function. Invalid parameter passed to C runtime function. Invalid parameter passed to C runtime function. {code} I'm going to guess we don't clean up the webview properly. Doesn't get triggered by the local html file, but from loading appcelerator.com. My best guess is some JS is running on a setTimeout or something like that and keeps trying to trigger on a partially GC'd webview. I tried calling stopLoading() and removing the listeners on the destructor, but that didn't seem to help any. In fact, I placed a breakpoint in the destructor and it was never called! I think we may have some issues where when a window is closed we don't clean up after it properly. When I switched to script only debugging, I saw the following (though not sure we'll change our homepage to fix these): {code} 'NMocha.exe' (Script): Loaded 'Script Code (WebView/3.0)'. Exception was thrown at line 4, column 14147 in http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js 0x800a139e - JavaScript runtime error: SyntaxError Exception was thrown at line 4, column 14533 in http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js 0x800a139e - JavaScript runtime error: SyntaxError Exception was thrown at line 30, column 191 in http://stats.g.doubleclick.net/dc.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 30, column 267 in http://stats.g.doubleclick.net/dc.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 30, column 390 in http://stats.g.doubleclick.net/dc.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 25, column 265 in http://a.adroll.com/j/roundtrip.js 0x800a138f - JavaScript runtime error: Unable to get property 'conv_value' of undefined or null reference Exception was thrown at line 16, column 1357 in http://www.google-analytics.com/analytics.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 16, column 1460 in http://www.google-analytics.com/analytics.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 16, column 1609 in http://www.google-analytics.com/analytics.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 16, column 1357 in http://www.google-analytics.com/analytics.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 16, column 1460 in http://www.google-analytics.com/analytics.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 16, column 1609 in http://www.google-analytics.com/analytics.js 0x800a1391 - JavaScript runtime error: 'ActiveXObject' is undefined Exception was thrown at line 1, column 26216 in https://js.intercomcdn.com/intercom.0d212436.js 0x800a139e - JavaScript runtime error: SyntaxError Exception was thrown at line 1, column 26609 in https://js.intercomcdn.com/intercom.0d212436.js 0x800a139e - JavaScript runtime error: SyntaxError {code}
Story points: 8