| 2035 | do |
| 2036 | { |
| 2037 | destroyPlayer(ch, NTRDisconnected); |
| 2038 | } while (users.getNext(it, ch)); |
| 2039 | } |
| 2040 | leaveUsr(); |
| 2041 | SLEEP_MS(DESTRUCT_WAIT); // waits till all players are gone.. |
| 2042 | |
| 2043 | // Now stop UDP threads and clean up the serverPeer. |
| 2044 | // The serverPeer is global/static, so we need to explicitly clean it up |
| 2045 | // to prevent threads from running after this NetServer instance is destroyed. |
| 2046 | poolLock.enter(); |
| 2047 | if (serverPeer) |
| 2048 | { |
| 2049 | serverPeer->close(); // Stops UDP listener/sender threads via poThreadJoin |
| 2050 | if (pool) |
nothing calls this directly
no test coverage detected