Codechange: use std::shared_ptr to manage saveload filters instead of manually trying to avoid double frees

This commit is contained in:
Rubidium
2024-02-02 18:13:38 +01:00
committed by rubidium42
parent 22eed9616e
commit 4b372b6050
8 changed files with 40 additions and 59 deletions

View File

@@ -576,7 +576,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendMap()
Debug(net, 9, "client[{}] SendMap(): first_packet", this->client_id);
WaitTillSaved();
this->savegame = new PacketWriter(this);
this->savegame = std::make_shared<PacketWriter>(this);
/* Now send the _frame_counter and how many packets are coming */
Packet *p = new Packet(PACKET_SERVER_MAP_BEGIN);