mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-25 22:40:16 +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);
|
||||
|
||||
// finally, remove it from the map and free it
|
||||
delete entity->viewableChunks;
|
||||
NPCs.erase(id);
|
||||
delete entity;
|
||||
}
|
||||
|
@ -81,6 +81,7 @@ void PlayerManager::removePlayer(CNSocket* key) {
|
||||
|
||||
std::cout << getPlayerName(key->plr) << " has left!" << std::endl;
|
||||
|
||||
delete plr->viewableChunks;
|
||||
key->plr = nullptr;
|
||||
delete plr;
|
||||
players.erase(key);
|
||||
|
Loading…
Reference in New Issue
Block a user