Fix /logout hang caused by blocking worker thread joins

unloadAll() joins worker threads which blocks if they're mid-tile
(prepareTile can take seconds for heavy ADTs). Replace with softReset()
which clears tile data, queues, and water surfaces without stopping
worker threads — workers find empty queues and idle naturally.
This commit is contained in:
Kelsi 2026-02-25 13:37:09 -08:00
parent 872b10fe68
commit 26a685187e
3 changed files with 30 additions and 2 deletions

View file

@ -661,9 +661,10 @@ void Application::logoutToLogin() {
if (auto* m2 = renderer->getM2Renderer()) {
m2->clear();
}
// Unload all terrain tiles + water surfaces so next world entry starts fresh
// Clear terrain tile tracking + water surfaces so next world entry starts fresh.
// Use softReset() instead of unloadAll() to avoid blocking on worker thread joins.
if (auto* terrain = renderer->getTerrainManager()) {
terrain->unloadAll();
terrain->softReset();
}
if (auto* questMarkers = renderer->getQuestMarkerRenderer()) {
questMarkers->clear();