I was able to reproduce several crashes due to non synchronized memory access by stressing out some SDK paths - connecting, disconnecting, and having no-ping timer event in parallel. Using sync queue for processDisconnect call inside no ping timer callback crashes gone away.
Still possible that the root cause in #68 is different, but hopefully that was caused by missing synchronization of disconnect processing inside no ping handler.
Also fixing issuing duplicate events here – i.e. if SDK emitted connecting event, it must not emit it again while in connecting state.
Relates #68
I was able to reproduce several crashes due to non synchronized memory access by stressing out some SDK paths - connecting, disconnecting, and having
no-ping
timer event in parallel. Using sync queue forprocessDisconnect
call inside no ping timer callback crashes gone away.Still possible that the root cause in #68 is different, but hopefully that was caused by missing synchronization of disconnect processing inside no ping handler.
Also fixing issuing duplicate events here – i.e. if SDK emitted
connecting
event, it must not emit it again while in connecting state.