[TIMOB-18724] Windows::HTTPClient crashes on firing onreadystatechange after being GCed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-03-25T09:58:42.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2015-03-20T15:01:56.000+0000 |
Updated | 2017-03-16T22:25:21.000+0000 |
Description
When running the mocha tests, I'm seeing some bad behavior from HTTPclient. We fire off requests in tests and continue on and eventually in a a later test (typically the layout suite) we'll get an error stemming from the HTTPClient firing an onreadystatechange callback:
Unhandled exception at 0x6B83D4C6 (HAL.dll) in NMocha.exe: 0xC0000005: Access violation reading location 0xDDDDDDDD.
It's in HTTPClient::onreadystatechange in Titaniumkit, where it's testing if the callback is a function. The issue is likely because we've long moved on from the test where the httpclient was generated - I'm thinking maybe it was GCed and we didn't properly cancel and clean up in our destructor.
The request was continuing in an async chain. My best guess is that we need to cancel all outstanding requests when the Windows impl desturctor hits, and null out the callback objects up in the TitaniumKit destructor?
https://github.com/appcelerator/titanium_mobile_windows/pull/181
Still seeing this locally when running the full mocha tests suite.
Closing ticket as fixed.