NetManager.PollEvents Exception and Crash on Nintendo Switch
Vonak opened this issue · 2 comments
I've got a weird crash/Exception occuring on a Nintendo Switch game, while puting the game in the background when coming back to it:
Attached a stacktrace showing the
_netEventsQueue.Dequeue()
call throwing an Empty Exception.
Seeing at the code of the PollEvents method and the 2 lock() sections, i can only imagine a different Thread Removing elements from the Queue, or Clear() while Shuting down due to inactivity in the background?
Right now i just tried to try/catch my PollEvent() call, and i didn't managed to reproduce the crash, but this kind of bugs are hardly easy to reproduce.
protected NetManager _netManager;
void Update()
{
_netManager?.PollEvents();
}
Library version: [release version (0.9.5.2)]
Framework: [Unity 2021.3.12f1 Nintendo Switch platform (LiteNet sources included into the project)]
OS: [Nintendo SDK 12.3.11]