mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-26 06:50:06 +00:00
Fix viewableChunks memory leaks
This commit is contained in:
parent
a9a8d96321
commit
e3568ea506
@ -84,6 +84,7 @@ void NPCManager::destroyNPC(int32_t id) {
|
|||||||
Eggs.erase(id);
|
Eggs.erase(id);
|
||||||
|
|
||||||
// finally, remove it from the map and free it
|
// finally, remove it from the map and free it
|
||||||
|
delete entity->viewableChunks;
|
||||||
NPCs.erase(id);
|
NPCs.erase(id);
|
||||||
delete entity;
|
delete entity;
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ void PlayerManager::removePlayer(CNSocket* key) {
|
|||||||
|
|
||||||
std::cout << getPlayerName(key->plr) << " has left!" << std::endl;
|
std::cout << getPlayerName(key->plr) << " has left!" << std::endl;
|
||||||
|
|
||||||
|
delete plr->viewableChunks;
|
||||||
key->plr = nullptr;
|
key->plr = nullptr;
|
||||||
delete plr;
|
delete plr;
|
||||||
players.erase(key);
|
players.erase(key);
|
||||||
|
Loading…
Reference in New Issue
Block a user