[MOD-2480] SocketIO: Event handler GC leads to crash (iOS)
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2019-02-25T23:08:58.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | n/a |
| Labels | n/a |
| Reporter | Jan Vennemann |
| Assignee | Jan Vennemann |
| Created | 2018-12-07T00:34:55.000+0000 |
| Updated | 2019-02-25T23:09:13.000+0000 |
Description
For compatibility with the web client we have our own event listener methods
on, once and off. Those do not properly protect the callback against GC so when the event listener is ultimately called and was already subject to GC the app will crash.
Thanks for creating the ticket Jan! If there is a workaround (e.g. by using callbacks directly), we could apply that temporarily to be unblocked from production. Thanks!
Try calling the proxy's
addEventListenerin addition toonoronceandremoveEventListenerwithoff.. That should take care of properly storing the callback and protecting it against GC. I have a fix incoming which does exactly the same behind the scenes.Fixed with version 2.0.0 of the socket.io module.