diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-03 21:13:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-03 21:13:18 +0300 |
commit | af61285030fa17604a0d3812c679c45cdc8c2a5d (patch) | |
tree | 1d37788d1e03b7cca8b20e3d6c4a68ad70ac02c9 | |
parent | 4546f29469d01fcbb5a030c4cf1746b786b495da (diff) | |
download | manaverse-af61285030fa17604a0d3812c679c45cdc8c2a5d.tar.gz manaverse-af61285030fa17604a0d3812c679c45cdc8c2a5d.tar.bz2 manaverse-af61285030fa17604a0d3812c679c45cdc8c2a5d.tar.xz manaverse-af61285030fa17604a0d3812c679c45cdc8c2a5d.zip |
Remove network handlers in general handler was deleted.
128 files changed, 489 insertions, 8 deletions
diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index d0703e501..ae8da9e4a 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -41,6 +41,11 @@ CharServerHandler::CharServerHandler() : { } +CharServerHandler::~CharServerHandler() +{ + clear(); +} + void CharServerHandler::setCharSelectDialog(CharSelectDialog *const window) const { diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index bd7d1cce2..1faa59403 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -36,6 +36,8 @@ class CharServerHandler notfinal : public Net::CharServerHandler public: A_DELETE_COPY(CharServerHandler) + ~CharServerHandler(); + void setCharSelectDialog(CharSelectDialog *const window) const override final; diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index c9f18ad86..8937852c6 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -41,6 +41,11 @@ ChatHandler::ChatHandler() ChatRecv::mSkipping = true; } +ChatHandler::~ChatHandler() +{ + clear(); +} + void ChatHandler::clear() const { ChatRecv::mShowMotd = config.getBoolValue("showmotd"); diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index 43b4de88b..b19105193 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -39,6 +39,8 @@ class ChatHandler notfinal : public Net::ChatHandler A_DELETE_COPY(ChatHandler) + ~ChatHandler(); + void me(const std::string &restrict text, const std::string &restrict channel) const override final; diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 531b4bdba..23f7347b9 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -45,6 +45,7 @@ PartyHandler::PartyHandler() : PartyHandler::~PartyHandler() { delete2(partyTab); + taParty = nullptr; } void PartyHandler::join(const int partyId A_UNUSED) const diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index 87ab97fec..45cfb9ed5 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -43,6 +43,11 @@ AdminHandler::AdminHandler() : adminHandler = this; } +AdminHandler::~AdminHandler() +{ + adminHandler = nullptr; +} + void AdminHandler::announce(const std::string &text) const { createOutPacket(CMSG_ADMIN_ANNOUNCE); diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h index 0c9e25e72..2cee9a354 100644 --- a/src/net/eathena/adminhandler.h +++ b/src/net/eathena/adminhandler.h @@ -35,6 +35,8 @@ class AdminHandler final : public Ea::AdminHandler A_DELETE_COPY(AdminHandler) + ~AdminHandler(); + void announce(const std::string &text) const override final; void localAnnounce(const std::string &text) const override final; diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp index 24c09f16a..709e15138 100644 --- a/src/net/eathena/auctionhandler.cpp +++ b/src/net/eathena/auctionhandler.cpp @@ -37,6 +37,11 @@ AuctionHandler::AuctionHandler() auctionHandler = this; } +AuctionHandler::~AuctionHandler() +{ + auctionHandler = nullptr; +} + void AuctionHandler::cancelReg() const { createOutPacket(CMSG_AUCTION_CANCEL_REG); diff --git a/src/net/eathena/auctionhandler.h b/src/net/eathena/auctionhandler.h index 21b70a4d5..097f4ca3b 100644 --- a/src/net/eathena/auctionhandler.h +++ b/src/net/eathena/auctionhandler.h @@ -32,6 +32,8 @@ class AuctionHandler final : public Net::AuctionHandler A_DELETE_COPY(AuctionHandler) + ~AuctionHandler(); + void cancelReg() const override final; void setItem(const Item *const item, diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp index 8c73bad91..19d600059 100644 --- a/src/net/eathena/bankhandler.cpp +++ b/src/net/eathena/bankhandler.cpp @@ -36,6 +36,11 @@ BankHandler::BankHandler() : bankHandler = this; } +BankHandler::~BankHandler() +{ + bankHandler = nullptr; +} + void BankHandler::deposit(const int money) const { if (packetVersion < 20130320) diff --git a/src/net/eathena/bankhandler.h b/src/net/eathena/bankhandler.h index 3686eee94..0e890a61e 100644 --- a/src/net/eathena/bankhandler.h +++ b/src/net/eathena/bankhandler.h @@ -32,6 +32,8 @@ class BankHandler final : public Net::BankHandler A_DELETE_COPY(BankHandler) + ~BankHandler(); + void deposit(const int money) const override final; void withdraw(const int money) const override final; diff --git a/src/net/eathena/battlegroundhandler.cpp b/src/net/eathena/battlegroundhandler.cpp index 606b90cc1..09bc28a01 100644 --- a/src/net/eathena/battlegroundhandler.cpp +++ b/src/net/eathena/battlegroundhandler.cpp @@ -35,6 +35,11 @@ BattleGroundHandler::BattleGroundHandler() battleGroundHandler = this; } +BattleGroundHandler::~BattleGroundHandler() +{ + battleGroundHandler = nullptr; +} + void BattleGroundHandler::registerBg(const BattleGroundTypeT &type, const std::string &name) const { diff --git a/src/net/eathena/battlegroundhandler.h b/src/net/eathena/battlegroundhandler.h index 7dca88a08..230146963 100644 --- a/src/net/eathena/battlegroundhandler.h +++ b/src/net/eathena/battlegroundhandler.h @@ -32,6 +32,8 @@ class BattleGroundHandler final : public Net::BattleGroundHandler A_DELETE_COPY(BattleGroundHandler) + ~BattleGroundHandler(); + void registerBg(const BattleGroundTypeT &type, const std::string &name) const override final; diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index d87b37b3d..d53848654 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -40,6 +40,11 @@ BeingHandler::BeingHandler(const bool enableSync) : beingHandler = this; } +BeingHandler::~BeingHandler() +{ + beingHandler = nullptr; +} + void BeingHandler::requestNameById(const BeingId id) const { createOutPacket(CMSG_NAME_REQUEST); diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index 0574f5270..cb8f8c248 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -35,6 +35,8 @@ class BeingHandler final : public Ea::BeingHandler A_DELETE_COPY(BeingHandler) + ~BeingHandler(); + void requestNameById(const BeingId id) const override final; void undress(Being *const being) const override final; diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index ae2157452..c4d172b89 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -44,6 +44,11 @@ BuyingStoreHandler::BuyingStoreHandler() buyingStoreHandler = this; } +BuyingStoreHandler::~BuyingStoreHandler() +{ + buyingStoreHandler = nullptr; +} + void BuyingStoreHandler::create(const std::string &name, const int maxMoney, const bool flag, diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h index 61b412bd6..8aed152c9 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -32,6 +32,8 @@ class BuyingStoreHandler final : public Net::BuyingStoreHandler A_DELETE_COPY(BuyingStoreHandler) + ~BuyingStoreHandler(); + void create(const std::string &name, const int maxMoney, const bool flag, diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index 19d555ff3..6858f0808 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -41,6 +41,11 @@ BuySellHandler::BuySellHandler() : Ea::BuySellRecv::mBuyDialog = nullptr; } +BuySellHandler::~BuySellHandler() +{ + buySellHandler = nullptr; +} + void BuySellHandler::requestSellList(const std::string &nick A_UNUSED) const { } diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h index 22a717424..b7aea35c7 100644 --- a/src/net/eathena/buysellhandler.h +++ b/src/net/eathena/buysellhandler.h @@ -35,6 +35,8 @@ class BuySellHandler final : public Ea::BuySellHandler A_DELETE_COPY(BuySellHandler) + ~BuySellHandler(); + void requestSellList(const std::string &nick) const override final A_CONST; diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp index c693cb1f0..2e1e9cde4 100644 --- a/src/net/eathena/cashshophandler.cpp +++ b/src/net/eathena/cashshophandler.cpp @@ -42,6 +42,11 @@ CashShopHandler::CashShopHandler() : CashShopRecv::mBuyDialog = nullptr; } +CashShopHandler::~CashShopHandler() +{ + cashShopHandler = nullptr; +} + void CashShopHandler::buyItem(const int points, const int itemId, const ItemColor color A_UNUSED, diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h index 8adfec064..7294b5cae 100644 --- a/src/net/eathena/cashshophandler.h +++ b/src/net/eathena/cashshophandler.h @@ -32,6 +32,8 @@ class CashShopHandler final : public Net::CashShopHandler A_DELETE_COPY(CashShopHandler) + ~CashShopHandler(); + void buyItem(const int points, const int itemId, const ItemColor color, diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index f9cd6729d..18273de0a 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -58,6 +58,11 @@ CharServerHandler::CharServerHandler() : charServerHandler = this; } +CharServerHandler::~CharServerHandler() +{ + charServerHandler = nullptr; +} + void CharServerHandler::chooseCharacter(Net::Character *const character) const { if (character == nullptr) diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h index 20b467120..cef8f868e 100644 --- a/src/net/eathena/charserverhandler.h +++ b/src/net/eathena/charserverhandler.h @@ -38,6 +38,8 @@ class CharServerHandler final : public Ea::CharServerHandler A_DELETE_COPY(CharServerHandler) + ~CharServerHandler(); + void chooseCharacter(Net::Character *const character) const override final; diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 0b630ee63..6b8e0517b 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -49,6 +49,11 @@ ChatHandler::ChatHandler() : chatHandler = this; } +ChatHandler::~ChatHandler() +{ + chatHandler = nullptr; +} + void ChatHandler::talk(const std::string &restrict text, const std::string &restrict channel A_UNUSED) const { diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index 6ed4dac0c..685327cd3 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -36,6 +36,8 @@ class ChatHandler final : public Ea::ChatHandler A_DELETE_COPY(ChatHandler) + ~ChatHandler(); + void talk(const std::string &restrict text, const std::string &restrict channel) const override final; diff --git a/src/net/eathena/elementalhandler.cpp b/src/net/eathena/elementalhandler.cpp index cc27fc39b..8a8fa56bb 100644 --- a/src/net/eathena/elementalhandler.cpp +++ b/src/net/eathena/elementalhandler.cpp @@ -31,4 +31,9 @@ ElementalHandler::ElementalHandler() : elementalHandler = this; } +ElementalHandler::~ElementalHandler() +{ + elementalHandler = nullptr; +} + } // namespace EAthena diff --git a/src/net/eathena/elementalhandler.h b/src/net/eathena/elementalhandler.h index 12b889959..517b74a30 100644 --- a/src/net/eathena/elementalhandler.h +++ b/src/net/eathena/elementalhandler.h @@ -31,6 +31,8 @@ class ElementalHandler final : public Net::ElementalHandler ElementalHandler(); A_DELETE_COPY(ElementalHandler) + + ~ElementalHandler(); }; } // namespace EAthena diff --git a/src/net/eathena/familyhandler.cpp b/src/net/eathena/familyhandler.cpp index e475503f0..5ec423ce5 100644 --- a/src/net/eathena/familyhandler.cpp +++ b/src/net/eathena/familyhandler.cpp @@ -40,6 +40,11 @@ FamilyHandler::FamilyHandler() : familyHandler = this; } +FamilyHandler::~FamilyHandler() +{ + familyHandler = nullptr; +} + void FamilyHandler::askForChild(const Being *const being) const { if (being == nullptr) diff --git a/src/net/eathena/familyhandler.h b/src/net/eathena/familyhandler.h index bd40a5610..91531fb2d 100644 --- a/src/net/eathena/familyhandler.h +++ b/src/net/eathena/familyhandler.h @@ -32,6 +32,8 @@ class FamilyHandler final : public Net::FamilyHandler A_DELETE_COPY(FamilyHandler) + ~FamilyHandler(); + void askForChild(const Being *const being) const override final; void askForChildReply(const bool accept) const override final; diff --git a/src/net/eathena/friendshandler.cpp b/src/net/eathena/friendshandler.cpp index e18f179bf..000ea909d 100644 --- a/src/net/eathena/friendshandler.cpp +++ b/src/net/eathena/friendshandler.cpp @@ -33,6 +33,11 @@ FriendsHandler::FriendsHandler() friendsHandler = this; } +FriendsHandler::~FriendsHandler() +{ + friendsHandler = nullptr; +} + void FriendsHandler::invite(const std::string &name) const { createOutPacket(CMSG_FRIENDS_ADD_PLAYER); diff --git a/src/net/eathena/friendshandler.h b/src/net/eathena/friendshandler.h index 47de5a35a..7b985e0ca 100644 --- a/src/net/eathena/friendshandler.h +++ b/src/net/eathena/friendshandler.h @@ -32,6 +32,8 @@ class FriendsHandler final : public Net::FriendsHandler A_DELETE_COPY(FriendsHandler) + ~FriendsHandler(); + void invite(const std::string &name) const override final; void inviteResponse(const int accountId, diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp index ca7fdf81a..1878e2298 100644 --- a/src/net/eathena/gamehandler.cpp +++ b/src/net/eathena/gamehandler.cpp @@ -52,6 +52,11 @@ GameHandler::GameHandler() : gameHandler = this; } +GameHandler::~GameHandler() +{ + gameHandler = nullptr; +} + void GameHandler::mapLoadedEvent() const { createOutPacket(CMSG_MAP_LOADED); diff --git a/src/net/eathena/gamehandler.h b/src/net/eathena/gamehandler.h index 76466db94..4b2725a2f 100644 --- a/src/net/eathena/gamehandler.h +++ b/src/net/eathena/gamehandler.h @@ -35,6 +35,8 @@ class GameHandler final : public Ea::GameHandler A_DELETE_COPY(GameHandler) + ~GameHandler(); + void connect() const override final; bool isConnected() const override final A_WARN_UNUSED; diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 71187cac7..9758b8a7d 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -117,6 +117,41 @@ GeneralHandler::GeneralHandler() : GeneralHandler::~GeneralHandler() { delete2(Network::mInstance); + + delete2(mAdminHandler); + delete2(mBeingHandler); + delete2(mBuySellHandler); + delete2(mCharServerHandler); + delete2(mChatHandler); + delete2(mGameHandler); + delete2(mGuildHandler); + delete2(mInventoryHandler); + delete2(mItemHandler); + delete2(mLoginHandler); + delete2(mNpcHandler); + delete2(mPartyHandler); + delete2(mPetHandler); + delete2(mPlayerHandler); + delete2(mSkillHandler); + delete2(mTradeHandler); + delete2(mQuestHandler); + delete2(mServerFeatures); + delete2(mMailHandler); + delete2(mAuctionHandler); + delete2(mCashShopHandler); + delete2(mFamilyHandler); + delete2(mBankHandler); + delete2(mBattleGroundHandler); + delete2(mMercenaryHandler); + delete2(mBuyingStoreHandler); + delete2(mHomunculusHandler); + delete2(mFriendsHandler); + delete2(mElementalHandler); + delete2(mMapHandler); + delete2(mMarketHandler); + delete2(mVendingHandler); + delete2(mRouletteHandler); + delete2(mSearchStoreHandler); } void GeneralHandler::load() const diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp index 178a628fc..b55918f85 100644 --- a/src/net/eathena/guildhandler.cpp +++ b/src/net/eathena/guildhandler.cpp @@ -53,6 +53,8 @@ GuildHandler::GuildHandler() : GuildHandler::~GuildHandler() { delete2(guildTab); + guildHandler = nullptr; + taGuild = nullptr; } void GuildHandler::clear() const diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index 482d29bce..3a3021387 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -39,6 +39,11 @@ HomunculusHandler::HomunculusHandler() homunculusHandler = this; } +HomunculusHandler::~HomunculusHandler() +{ + homunculusHandler = nullptr; +} + void HomunculusHandler::setName(const std::string &name) const { createOutPacket(CMSG_HOMUNCULUS_SET_NAME); diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h index 868f22e89..817c6ee75 100644 --- a/src/net/eathena/homunculushandler.h +++ b/src/net/eathena/homunculushandler.h @@ -32,6 +32,8 @@ class HomunculusHandler final : public Net::HomunculusHandler A_DELETE_COPY(HomunculusHandler) + ~HomunculusHandler(); + void setName(const std::string &name) const override final; void moveToMaster() const override final; diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index ed9296a8b..f59dc4c6c 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -77,6 +77,7 @@ InventoryHandler::InventoryHandler() : InventoryHandler::~InventoryHandler() { + inventoryHandler = nullptr; } void InventoryHandler::equipItem(const Item *const item) const diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index 1c8e25e69..35a8cf77f 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -48,6 +48,7 @@ LoginHandler::LoginHandler() : LoginHandler::~LoginHandler() { + loginHandler = nullptr; } void LoginHandler::connect() const diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index 4ecbfdda4..44edeb5bd 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -35,6 +35,11 @@ MailHandler::MailHandler() mailHandler = this; } +MailHandler::~MailHandler() +{ + mailHandler = nullptr; +} + void MailHandler::refresh() const { createOutPacket(CMSG_MAIL_REFRESH_INBOX); diff --git a/src/net/eathena/mailhandler.h b/src/net/eathena/mailhandler.h index e7bd13004..4d55238a6 100644 --- a/src/net/eathena/mailhandler.h +++ b/src/net/eathena/mailhandler.h @@ -33,6 +33,8 @@ class MailHandler final : public Net::MailHandler A_DELETE_COPY(MailHandler) + ~MailHandler(); + void refresh() const override final; void readMessage(const int msgId) const override final; diff --git a/src/net/eathena/maphandler.cpp b/src/net/eathena/maphandler.cpp index 042f87778..b16fc664f 100644 --- a/src/net/eathena/maphandler.cpp +++ b/src/net/eathena/maphandler.cpp @@ -31,4 +31,9 @@ MapHandler::MapHandler() : mapHandler = this; } +MapHandler::~MapHandler() +{ + mapHandler = nullptr; +} + } // namespace EAthena diff --git a/src/net/eathena/maphandler.h b/src/net/eathena/maphandler.h index 432039209..d9da12ded 100644 --- a/src/net/eathena/maphandler.h +++ b/src/net/eathena/maphandler.h @@ -38,14 +38,7 @@ class MapHandler final : public Net::MapHandler A_DELETE_COPY(MapHandler) - protected: - void processInstanceStart(Net::MessageIn &msg); - - void processInstanceCreate(Net::MessageIn &msg); - - void processInstanceInfo(Net::MessageIn &msg); - - void processInstanceDelete(Net::MessageIn &msg); + ~MapHandler(); }; } // namespace EAthena diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index 98b8b5d9f..46bf44027 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -42,6 +42,11 @@ MarketHandler::MarketHandler() : MarketRecv::mBuyDialog = nullptr; } +MarketHandler::~MarketHandler() +{ + marketHandler = nullptr; +} + void MarketHandler::close() const { if (packetVersion < 20131218) diff --git a/src/net/eathena/markethandler.h b/src/net/eathena/markethandler.h index 8fe2c4bfb..c06018c0b 100644 --- a/src/net/eathena/markethandler.h +++ b/src/net/eathena/markethandler.h @@ -33,6 +33,8 @@ class MarketHandler final : public Net::MarketHandler A_DELETE_COPY(MarketHandler) + ~MarketHandler(); + void close() const override final; void buyItem(const int itemId, diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 0159a5cbd..ffb1b5b2c 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -37,6 +37,11 @@ MercenaryHandler::MercenaryHandler() mercenaryHandler = this; } +MercenaryHandler::~MercenaryHandler() +{ + mercenaryHandler = nullptr; +} + void MercenaryHandler::fire() const { createOutPacket(CMSG_MERCENARY_ACTION); diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h index 05a5363e4..bd5e06b14 100644 --- a/src/net/eathena/mercenaryhandler.h +++ b/src/net/eathena/mercenaryhandler.h @@ -32,6 +32,8 @@ class MercenaryHandler final : public Net::MercenaryHandler A_DELETE_COPY(MercenaryHandler) + ~MercenaryHandler(); + void fire() const override final; void moveToMaster() const override final; diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index 65e05e866..50d076ec4 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -56,6 +56,11 @@ NpcHandler::NpcHandler() : npcHandler = this; } +NpcHandler::~NpcHandler() +{ + npcHandler = nullptr; +} + void NpcHandler::talk(const Being *const being) const { if (being == nullptr) diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h index f1f259718..e5177d7c9 100644 --- a/src/net/eathena/npchandler.h +++ b/src/net/eathena/npchandler.h @@ -35,6 +35,8 @@ class NpcHandler final : public Ea::NpcHandler A_DELETE_COPY(NpcHandler) + ~NpcHandler(); + void talk(const Being *const being) const override final; void nextDialog(const BeingId npcId) const override final; diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index 7f59ec4db..bc3bcfb83 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -50,6 +50,7 @@ PartyHandler::PartyHandler() : PartyHandler::~PartyHandler() { + partyHandler = nullptr; } void PartyHandler::create(const std::string &name) const diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index 043acbedc..28624e285 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -37,6 +37,11 @@ PetHandler::PetHandler() petHandler = this; } +PetHandler::~PetHandler() +{ + petHandler = nullptr; +} + void PetHandler::move(const int x, const int y) const { diff --git a/src/net/eathena/pethandler.h b/src/net/eathena/pethandler.h index 449daac43..9785ade7d 100644 --- a/src/net/eathena/pethandler.h +++ b/src/net/eathena/pethandler.h @@ -33,6 +33,8 @@ class PetHandler final : public Net::PetHandler A_DELETE_COPY(PetHandler) + ~PetHandler(); + void move(const int x, const int y) const override final; diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 02c56c869..4c728fb2f 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -56,6 +56,11 @@ PlayerHandler::PlayerHandler() : playerHandler = this; } +PlayerHandler::~PlayerHandler() +{ + playerHandler = nullptr; +} + void PlayerHandler::attack(const BeingId id, const Keep keep) const { diff --git a/src/net/eathena/playerhandler.h b/src/net/eathena/playerhandler.h index 683e761b9..1b000025c 100644 --- a/src/net/eathena/playerhandler.h +++ b/src/net/eathena/playerhandler.h @@ -35,6 +35,8 @@ class PlayerHandler final : public Ea::PlayerHandler A_DELETE_COPY(PlayerHandler) + ~PlayerHandler(); + void attack(const BeingId id, const Keep keep) const override final; void stopAttack() const override final; diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp index 6af26f4fe..0db26ebf4 100644 --- a/src/net/eathena/questhandler.cpp +++ b/src/net/eathena/questhandler.cpp @@ -34,6 +34,11 @@ QuestHandler::QuestHandler() : questHandler = this; } +QuestHandler::~QuestHandler() +{ + questHandler = nullptr; +} + void QuestHandler::setQeustActiveState(const int questId, const bool active) const { diff --git a/src/net/eathena/questhandler.h b/src/net/eathena/questhandler.h index 5b857d384..2c5f18b67 100644 --- a/src/net/eathena/questhandler.h +++ b/src/net/eathena/questhandler.h @@ -33,6 +33,8 @@ class QuestHandler final : public Net::QuestHandler A_DELETE_COPY(QuestHandler) + ~QuestHandler(); + void setQeustActiveState(const int questId, const bool active) const override final; }; diff --git a/src/net/eathena/roulettehandler.cpp b/src/net/eathena/roulettehandler.cpp index 6e107af38..b0d9d2829 100644 --- a/src/net/eathena/roulettehandler.cpp +++ b/src/net/eathena/roulettehandler.cpp @@ -31,4 +31,9 @@ RouletteHandler::RouletteHandler() : rouletteHandler = this; } +RouletteHandler::~RouletteHandler() +{ + rouletteHandler = nullptr; +} + } // namespace EAthena diff --git a/src/net/eathena/roulettehandler.h b/src/net/eathena/roulettehandler.h index 09d5d94d7..861f54582 100644 --- a/src/net/eathena/roulettehandler.h +++ b/src/net/eathena/roulettehandler.h @@ -31,6 +31,8 @@ class RouletteHandler final : public Net::RouletteHandler RouletteHandler(); A_DELETE_COPY(RouletteHandler) + + ~RouletteHandler(); }; } // namespace EAthena diff --git a/src/net/eathena/searchstorehandler.cpp b/src/net/eathena/searchstorehandler.cpp index d9b4625cc..c8cd43d2d 100644 --- a/src/net/eathena/searchstorehandler.cpp +++ b/src/net/eathena/searchstorehandler.cpp @@ -36,6 +36,11 @@ SearchStoreHandler::SearchStoreHandler() : searchStoreHandler = this; } +SearchStoreHandler::~SearchStoreHandler() +{ + searchStoreHandler = nullptr; +} + void SearchStoreHandler::search(const StoreSearchTypeT type, const int minPrice, const int maxPrice, diff --git a/src/net/eathena/searchstorehandler.h b/src/net/eathena/searchstorehandler.h index 151086a0d..5e425e6e5 100644 --- a/src/net/eathena/searchstorehandler.h +++ b/src/net/eathena/searchstorehandler.h @@ -32,6 +32,8 @@ class SearchStoreHandler final : public Net::SearchStoreHandler A_DELETE_COPY(SearchStoreHandler) + ~SearchStoreHandler(); + void search(const StoreSearchTypeT type, const int minPrice, const int maxPrice, diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp index f3acb257f..ec8176eef 100644 --- a/src/net/eathena/skillhandler.cpp +++ b/src/net/eathena/skillhandler.cpp @@ -39,6 +39,11 @@ SkillHandler::SkillHandler() : skillHandler = this; } +SkillHandler::~SkillHandler() +{ + skillHandler = nullptr; +} + void SkillHandler::useBeing(const int id, const int level, const BeingId beingId) const { diff --git a/src/net/eathena/skillhandler.h b/src/net/eathena/skillhandler.h index 63ef06619..d615dac77 100644 --- a/src/net/eathena/skillhandler.h +++ b/src/net/eathena/skillhandler.h @@ -35,6 +35,8 @@ class SkillHandler final : public Ea::SkillHandler A_DELETE_COPY(SkillHandler) + ~SkillHandler(); + void useBeing(const int id, const int level, const BeingId beingId) const override final; diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index 94ea4fb9d..5c6877f5e 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -36,6 +36,7 @@ namespace EAthena { + TradeHandler::TradeHandler() : Ea::TradeHandler() { @@ -44,6 +45,11 @@ TradeHandler::TradeHandler() : TradeRecv::mQuantity = 0; } +TradeHandler::~TradeHandler() +{ + tradeHandler = nullptr; +} + void TradeHandler::request(const Being *const being) const { if (being == nullptr) diff --git a/src/net/eathena/tradehandler.h b/src/net/eathena/tradehandler.h index 5934544ea..0bf5b2eb2 100644 --- a/src/net/eathena/tradehandler.h +++ b/src/net/eathena/tradehandler.h @@ -35,6 +35,8 @@ class TradeHandler final : public Ea::TradeHandler A_DELETE_COPY(TradeHandler) + ~TradeHandler(); + void request(const Being *const being) const override final; void respond(const bool accept) const override final; diff --git a/src/net/eathena/vendinghandler.cpp b/src/net/eathena/vendinghandler.cpp index c5791cfd5..73fa5d12b 100644 --- a/src/net/eathena/vendinghandler.cpp +++ b/src/net/eathena/vendinghandler.cpp @@ -44,6 +44,11 @@ VendingHandler::VendingHandler() VendingRecv::mBuyDialog = nullptr; } +VendingHandler::~VendingHandler() +{ + vendingHandler = nullptr; +} + void VendingHandler::close() const { createOutPacket(CMSG_VENDING_CLOSE); diff --git a/src/net/eathena/vendinghandler.h b/src/net/eathena/vendinghandler.h index d8d3948f6..7929a6d19 100644 --- a/src/net/eathena/vendinghandler.h +++ b/src/net/eathena/vendinghandler.h @@ -32,6 +32,8 @@ class VendingHandler final : public Net::VendingHandler A_DELETE_COPY(VendingHandler) + ~VendingHandler(); + void close() const override final; void open(const Being *const being) const override final; diff --git a/src/net/net.cpp b/src/net/net.cpp index 7f394bcc4..3bd115bf0 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -32,6 +32,8 @@ #include "net/eathena/generalhandler.h" +#include "utils/delete2.h" + #include "debug.h" namespace Net @@ -165,6 +167,7 @@ void unload() if (handler != nullptr) handler->unload(); ignorePackets.clear(); + delete2(generalHandler); } ServerTypeT getNetworkType() diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index cd6583520..b0d2ebfa3 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -41,6 +41,11 @@ AdminHandler::AdminHandler() : adminHandler = this; } +AdminHandler::~AdminHandler() +{ + adminHandler = nullptr; +} + void AdminHandler::announce(const std::string &text) const { createOutPacket(CMSG_ADMIN_ANNOUNCE); diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index 7cbf7c0f8..01e7adcac 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -35,6 +35,8 @@ class AdminHandler final : public Ea::AdminHandler A_DELETE_COPY(AdminHandler) + ~AdminHandler(); + void announce(const std::string &text) const override final; void localAnnounce(const std::string &text) const override final; diff --git a/src/net/tmwa/auctionhandler.cpp b/src/net/tmwa/auctionhandler.cpp index d1538c1db..1a45e4135 100644 --- a/src/net/tmwa/auctionhandler.cpp +++ b/src/net/tmwa/auctionhandler.cpp @@ -30,6 +30,11 @@ AuctionHandler::AuctionHandler() auctionHandler = this; } +AuctionHandler::~AuctionHandler() +{ + auctionHandler = nullptr; +} + void AuctionHandler::cancelReg() const { } diff --git a/src/net/tmwa/auctionhandler.h b/src/net/tmwa/auctionhandler.h index c8161f8af..9e88e603d 100644 --- a/src/net/tmwa/auctionhandler.h +++ b/src/net/tmwa/auctionhandler.h @@ -32,6 +32,8 @@ class AuctionHandler final : public Net::AuctionHandler A_DELETE_COPY(AuctionHandler) + ~AuctionHandler(); + void cancelReg() const override final A_CONST; void setItem(const Item *const item, diff --git a/src/net/tmwa/bankhandler.cpp b/src/net/tmwa/bankhandler.cpp index 521eb6d4c..cacab379f 100644 --- a/src/net/tmwa/bankhandler.cpp +++ b/src/net/tmwa/bankhandler.cpp @@ -31,6 +31,11 @@ BankHandler::BankHandler() : bankHandler = this; } +BankHandler::~BankHandler() +{ + bankHandler = nullptr; +} + void BankHandler::deposit(const int money A_UNUSED) const { } diff --git a/src/net/tmwa/bankhandler.h b/src/net/tmwa/bankhandler.h index 55eab9716..a99b7d50d 100644 --- a/src/net/tmwa/bankhandler.h +++ b/src/net/tmwa/bankhandler.h @@ -33,6 +33,8 @@ class BankHandler final : public Net::BankHandler A_DELETE_COPY(BankHandler) + ~BankHandler(); + void deposit(const int money) const override final A_CONST; void withdraw(const int money) const override final A_CONST; diff --git a/src/net/tmwa/battlegroundhandler.cpp b/src/net/tmwa/battlegroundhandler.cpp index ecb80f177..b8631da1b 100644 --- a/src/net/tmwa/battlegroundhandler.cpp +++ b/src/net/tmwa/battlegroundhandler.cpp @@ -30,6 +30,11 @@ BattleGroundHandler::BattleGroundHandler() battleGroundHandler = this; } +BattleGroundHandler::~BattleGroundHandler() +{ + battleGroundHandler = nullptr; +} + void BattleGroundHandler::registerBg(const BattleGroundTypeT &type A_UNUSED, const std::string &name A_UNUSED) const diff --git a/src/net/tmwa/battlegroundhandler.h b/src/net/tmwa/battlegroundhandler.h index b04b9d8fa..2a1126589 100644 --- a/src/net/tmwa/battlegroundhandler.h +++ b/src/net/tmwa/battlegroundhandler.h @@ -33,6 +33,8 @@ class BattleGroundHandler final : public Net::BattleGroundHandler A_DELETE_COPY(BattleGroundHandler) + ~BattleGroundHandler(); + void registerBg(const BattleGroundTypeT &type, const std::string &name) const override final A_CONST; diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index da0b18fbf..c4e57627e 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -37,6 +37,11 @@ BeingHandler::BeingHandler(const bool enableSync) : beingHandler = this; } +BeingHandler::~BeingHandler() +{ + beingHandler = nullptr; +} + void BeingHandler::requestNameById(const BeingId id) const { createOutPacket(CMSG_NAME_REQUEST); diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h index 97e46feb3..04cced3ed 100644 --- a/src/net/tmwa/beinghandler.h +++ b/src/net/tmwa/beinghandler.h @@ -35,6 +35,8 @@ class BeingHandler final : public Ea::BeingHandler A_DELETE_COPY(BeingHandler) + ~BeingHandler(); + void requestNameById(const BeingId id) const override final; void undress(Being *const being) const override final; diff --git a/src/net/tmwa/buyingstorehandler.cpp b/src/net/tmwa/buyingstorehandler.cpp index 9ea2a9822..4d028f918 100644 --- a/src/net/tmwa/buyingstorehandler.cpp +++ b/src/net/tmwa/buyingstorehandler.cpp @@ -30,6 +30,11 @@ BuyingStoreHandler::BuyingStoreHandler() buyingStoreHandler = this; } +BuyingStoreHandler::~BuyingStoreHandler() +{ + buyingStoreHandler = nullptr; +} + void BuyingStoreHandler::create(const std::string &name A_UNUSED, const int maxMoney A_UNUSED, const bool flag A_UNUSED, diff --git a/src/net/tmwa/buyingstorehandler.h b/src/net/tmwa/buyingstorehandler.h index 5a9ce21cc..584293021 100644 --- a/src/net/tmwa/buyingstorehandler.h +++ b/src/net/tmwa/buyingstorehandler.h @@ -33,6 +33,8 @@ class BuyingStoreHandler final : public Net::BuyingStoreHandler A_DELETE_COPY(BuyingStoreHandler) + ~BuyingStoreHandler(); + void create(const std::string &name, const int maxMoney, const bool flag, diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index e343614bd..7d69c8a7a 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -45,6 +45,11 @@ BuySellHandler::BuySellHandler() : Ea::BuySellRecv::mBuyDialog = nullptr; } +BuySellHandler::~BuySellHandler() +{ + buySellHandler = nullptr; +} + void BuySellHandler::requestSellList(const std::string &nick) const { if (nick.empty() || shopWindow == nullptr) diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h index 0d506a67c..461935cda 100644 --- a/src/net/tmwa/buysellhandler.h +++ b/src/net/tmwa/buysellhandler.h @@ -35,6 +35,8 @@ class BuySellHandler final : public Ea::BuySellHandler A_DELETE_COPY(BuySellHandler) + ~BuySellHandler(); + void requestSellList(const std::string &nick) const override final; diff --git a/src/net/tmwa/cashshophandler.cpp b/src/net/tmwa/cashshophandler.cpp index 81a8e2871..9477af1cc 100644 --- a/src/net/tmwa/cashshophandler.cpp +++ b/src/net/tmwa/cashshophandler.cpp @@ -31,6 +31,11 @@ CashShopHandler::CashShopHandler() : cashShopHandler = this; } +CashShopHandler::~CashShopHandler() +{ + cashShopHandler = nullptr; +} + void CashShopHandler::buyItem(const int points A_UNUSED, const int itemId A_UNUSED, const ItemColor color A_UNUSED, diff --git a/src/net/tmwa/cashshophandler.h b/src/net/tmwa/cashshophandler.h index 328758960..31d5872dd 100644 --- a/src/net/tmwa/cashshophandler.h +++ b/src/net/tmwa/cashshophandler.h @@ -33,6 +33,8 @@ class CashShopHandler final : public Net::CashShopHandler A_DELETE_COPY(CashShopHandler) + ~CashShopHandler(); + void buyItem(const int points, const int itemId, const ItemColor color, diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 4d5ae293b..258c1c163 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -52,6 +52,11 @@ CharServerHandler::CharServerHandler() : charServerHandler = this; } +CharServerHandler::~CharServerHandler() +{ + charServerHandler = nullptr; +} + void CharServerHandler::chooseCharacter(Net::Character *const character) const { if (character == nullptr) diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h index 43050b365..e71fdb1b9 100644 --- a/src/net/tmwa/charserverhandler.h +++ b/src/net/tmwa/charserverhandler.h @@ -38,6 +38,8 @@ class CharServerHandler final : public Ea::CharServerHandler A_DELETE_COPY(CharServerHandler) + ~CharServerHandler(); + void chooseCharacter(Net::Character *const character) const override final; diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 1b706495f..2b768ffe2 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -47,6 +47,11 @@ ChatHandler::ChatHandler() : chatHandler = this; } +ChatHandler::~ChatHandler() +{ + chatHandler = nullptr; +} + void ChatHandler::talk(const std::string &restrict text, const std::string &restrict channel A_UNUSED) const { diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index faa0833d3..12de8067c 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -36,6 +36,8 @@ class ChatHandler final : public Ea::ChatHandler A_DELETE_COPY(ChatHandler) + ~ChatHandler(); + void talk(const std::string &restrict text, const std::string &restrict channel) const override final; diff --git a/src/net/tmwa/elementalhandler.cpp b/src/net/tmwa/elementalhandler.cpp index bf9caae25..78230f3df 100644 --- a/src/net/tmwa/elementalhandler.cpp +++ b/src/net/tmwa/elementalhandler.cpp @@ -31,4 +31,9 @@ ElementalHandler::ElementalHandler() : elementalHandler = this; } +ElementalHandler::~ElementalHandler() +{ + elementalHandler = nullptr; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/elementalhandler.h b/src/net/tmwa/elementalhandler.h index 0823ea262..5aea5b5d2 100644 --- a/src/net/tmwa/elementalhandler.h +++ b/src/net/tmwa/elementalhandler.h @@ -31,6 +31,8 @@ namespace TmwAthena ElementalHandler(); A_DELETE_COPY(ElementalHandler) + + ~ElementalHandler(); }; } // namespace TmwAthena diff --git a/src/net/tmwa/familyhandler.cpp b/src/net/tmwa/familyhandler.cpp index b347e9880..9f5bb7fe9 100644 --- a/src/net/tmwa/familyhandler.cpp +++ b/src/net/tmwa/familyhandler.cpp @@ -31,6 +31,11 @@ FamilyHandler::FamilyHandler() : familyHandler = this; } +FamilyHandler::~FamilyHandler() +{ + familyHandler = nullptr; +} + void FamilyHandler::askForChild(const Being *const being A_UNUSED) const { } diff --git a/src/net/tmwa/familyhandler.h b/src/net/tmwa/familyhandler.h index c62e7f996..b2cc6c96a 100644 --- a/src/net/tmwa/familyhandler.h +++ b/src/net/tmwa/familyhandler.h @@ -33,6 +33,8 @@ class FamilyHandler final : public Net::FamilyHandler A_DELETE_COPY(FamilyHandler) + ~FamilyHandler(); + void askForChild(const Being *const being) const override final A_CONST; diff --git a/src/net/tmwa/friendshandler.cpp b/src/net/tmwa/friendshandler.cpp index 99f99c576..094952df4 100644 --- a/src/net/tmwa/friendshandler.cpp +++ b/src/net/tmwa/friendshandler.cpp @@ -30,6 +30,11 @@ FriendsHandler::FriendsHandler() friendsHandler = this; } +FriendsHandler::~FriendsHandler() +{ + friendsHandler = nullptr; +} + void FriendsHandler::invite(const std::string &name A_UNUSED) const { } diff --git a/src/net/tmwa/friendshandler.h b/src/net/tmwa/friendshandler.h index b6db2d5b4..ef9d05c60 100644 --- a/src/net/tmwa/friendshandler.h +++ b/src/net/tmwa/friendshandler.h @@ -32,6 +32,8 @@ class FriendsHandler final : public Net::FriendsHandler A_DELETE_COPY(FriendsHandler) + ~FriendsHandler(); + void invite(const std::string &name) const override final A_CONST; void inviteResponse(const int accountId, diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 2fec57df3..d13c46919 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -48,6 +48,11 @@ GameHandler::GameHandler() : gameHandler = this; } +GameHandler::~GameHandler() +{ + gameHandler = nullptr; +} + void GameHandler::mapLoadedEvent() const { createOutPacket(CMSG_MAP_LOADED); diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index c38880eb3..78d30e7e3 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -35,6 +35,8 @@ class GameHandler final : public Ea::GameHandler A_DELETE_COPY(GameHandler) + ~GameHandler(); + void connect() const override final; bool isConnected() const override final A_WARN_UNUSED; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 577d384b7..9f47c20ba 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -117,6 +117,41 @@ GeneralHandler::GeneralHandler() : GeneralHandler::~GeneralHandler() { delete2(Network::mInstance); + + delete2(mAdminHandler); + delete2(mBeingHandler); + delete2(mBuySellHandler); + delete2(mCharServerHandler); + delete2(mChatHandler); + delete2(mGameHandler); + delete2(mGuildHandler); + delete2(mInventoryHandler); + delete2(mItemHandler); + delete2(mLoginHandler); + delete2(mNpcHandler); + delete2(mPartyHandler); + delete2(mPetHandler); + delete2(mPlayerHandler); + delete2(mSkillHandler); + delete2(mTradeHandler); + delete2(mQuestHandler); + delete2(mServerFeatures); + delete2(mAuctionHandler); + delete2(mBankHandler); + delete2(mBattleGroundHandler); + delete2(mBuyingStoreHandler); + delete2(mCashShopHandler); + delete2(mElementalHandler); + delete2(mFamilyHandler); + delete2(mFriendsHandler); + delete2(mHomunculusHandler); + delete2(mMailHandler); + delete2(mMapHandler); + delete2(mMarketHandler); + delete2(mMercenaryHandler); + delete2(mRouletteHandler); + delete2(mSearchStoreHandler); + delete2(mVendingHandler); } void GeneralHandler::load() const diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 926d15d59..5b41ef49a 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -34,6 +34,7 @@ GuildHandler::GuildHandler() : GuildHandler::~GuildHandler() { + guildHandler = nullptr; } void GuildHandler::clear() const diff --git a/src/net/tmwa/homunculushandler.cpp b/src/net/tmwa/homunculushandler.cpp index 320e43b7d..0d1bb2e62 100644 --- a/src/net/tmwa/homunculushandler.cpp +++ b/src/net/tmwa/homunculushandler.cpp @@ -30,6 +30,11 @@ HomunculusHandler::HomunculusHandler() homunculusHandler = this; } +HomunculusHandler::~HomunculusHandler() +{ + homunculusHandler = nullptr; +} + void HomunculusHandler::setName(const std::string &name A_UNUSED) const { } diff --git a/src/net/tmwa/homunculushandler.h b/src/net/tmwa/homunculushandler.h index 3ac2d22a7..bd00927fa 100644 --- a/src/net/tmwa/homunculushandler.h +++ b/src/net/tmwa/homunculushandler.h @@ -33,6 +33,8 @@ class HomunculusHandler final : public Net::HomunculusHandler A_DELETE_COPY(HomunculusHandler) + ~HomunculusHandler(); + void setName(const std::string &name) const override final A_CONST; void moveToMaster() const override final A_CONST; diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 8328f159a..e87b748c7 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -63,6 +63,7 @@ InventoryHandler::InventoryHandler() : InventoryHandler::~InventoryHandler() { + inventoryHandler = nullptr; } void InventoryHandler::equipItem(const Item *const item) const diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index ea57a6f5a..566cc5b09 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -47,6 +47,7 @@ LoginHandler::LoginHandler() : LoginHandler::~LoginHandler() { + loginHandler = nullptr; } void LoginHandler::connect() const diff --git a/src/net/tmwa/mailhandler.cpp b/src/net/tmwa/mailhandler.cpp index c339fd067..2a124e504 100644 --- a/src/net/tmwa/mailhandler.cpp +++ b/src/net/tmwa/mailhandler.cpp @@ -30,6 +30,11 @@ MailHandler::MailHandler() mailHandler = this; } +MailHandler::~MailHandler() +{ + mailHandler = nullptr; +} + void MailHandler::refresh() const { } diff --git a/src/net/tmwa/mailhandler.h b/src/net/tmwa/mailhandler.h index 94b6981c7..94867a7a7 100644 --- a/src/net/tmwa/mailhandler.h +++ b/src/net/tmwa/mailhandler.h @@ -33,6 +33,8 @@ class MailHandler final : public Net::MailHandler A_DELETE_COPY(MailHandler) + ~MailHandler(); + void refresh() const override final A_CONST; void readMessage(const int msgId) const override final A_CONST; diff --git a/src/net/tmwa/maphandler.cpp b/src/net/tmwa/maphandler.cpp index 277cf8e9c..642480a4d 100644 --- a/src/net/tmwa/maphandler.cpp +++ b/src/net/tmwa/maphandler.cpp @@ -31,4 +31,9 @@ MapHandler::MapHandler() : mapHandler = this; } +MapHandler::~MapHandler() +{ + mapHandler = nullptr; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/maphandler.h b/src/net/tmwa/maphandler.h index df061dde2..10382222d 100644 --- a/src/net/tmwa/maphandler.h +++ b/src/net/tmwa/maphandler.h @@ -32,6 +32,8 @@ class MapHandler final : public Net::MapHandler MapHandler(); A_DELETE_COPY(MapHandler) + + ~MapHandler(); }; } // namespace TmwAthena diff --git a/src/net/tmwa/markethandler.cpp b/src/net/tmwa/markethandler.cpp index e5e64d9a1..1a2f6b548 100644 --- a/src/net/tmwa/markethandler.cpp +++ b/src/net/tmwa/markethandler.cpp @@ -31,6 +31,11 @@ MarketHandler::MarketHandler() : marketHandler = this; } +MarketHandler::~MarketHandler() +{ + marketHandler = nullptr; +} + void MarketHandler::close() const { } diff --git a/src/net/tmwa/markethandler.h b/src/net/tmwa/markethandler.h index fe0f97006..923b697c0 100644 --- a/src/net/tmwa/markethandler.h +++ b/src/net/tmwa/markethandler.h @@ -32,6 +32,8 @@ class MarketHandler final : public Net::MarketHandler A_DELETE_COPY(MarketHandler) + ~MarketHandler(); + void close() const override final A_CONST; void buyItem(const int itemId, diff --git a/src/net/tmwa/mercenaryhandler.cpp b/src/net/tmwa/mercenaryhandler.cpp index 9e1b58c50..7f824180a 100644 --- a/src/net/tmwa/mercenaryhandler.cpp +++ b/src/net/tmwa/mercenaryhandler.cpp @@ -30,6 +30,11 @@ MercenaryHandler::MercenaryHandler() mercenaryHandler = this; } +MercenaryHandler::~MercenaryHandler() +{ + mercenaryHandler = nullptr; +} + void MercenaryHandler::fire() const { } diff --git a/src/net/tmwa/mercenaryhandler.h b/src/net/tmwa/mercenaryhandler.h index 925f0d7db..eaba1f2fd 100644 --- a/src/net/tmwa/mercenaryhandler.h +++ b/src/net/tmwa/mercenaryhandler.h @@ -33,6 +33,8 @@ class MercenaryHandler final : public Net::MercenaryHandler A_DELETE_COPY(MercenaryHandler) + ~MercenaryHandler(); + void fire() const override final A_CONST; void moveToMaster() const override final A_CONST; diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index 9478282ea..e4a9296fc 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -48,6 +48,11 @@ NpcHandler::NpcHandler() : npcHandler = this; } +NpcHandler::~NpcHandler() +{ + npcHandler = nullptr; +} + void NpcHandler::talk(const Being *const being) const { if (being == nullptr) diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index 5f413012f..14bfefb66 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -35,6 +35,8 @@ class NpcHandler final : public Ea::NpcHandler A_DELETE_COPY(NpcHandler) + ~NpcHandler(); + void talk(const Being *const being) const override final; void nextDialog(const BeingId npcId) const override final; diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index 64bebcde7..cef9588f7 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -47,6 +47,7 @@ PartyHandler::PartyHandler() : PartyHandler::~PartyHandler() { + partyHandler = nullptr; } void PartyHandler::create(const std::string &name) const diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp index adb82f16f..c10fd5882 100644 --- a/src/net/tmwa/pethandler.cpp +++ b/src/net/tmwa/pethandler.cpp @@ -31,6 +31,11 @@ PetHandler::PetHandler() : petHandler = this; } +PetHandler::~PetHandler() +{ + petHandler = nullptr; +} + void PetHandler::move(const int x A_UNUSED, const int y A_UNUSED) const { diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h index 1e2f01c48..e7a816d21 100644 --- a/src/net/tmwa/pethandler.h +++ b/src/net/tmwa/pethandler.h @@ -33,6 +33,8 @@ class PetHandler final : public Net::PetHandler A_DELETE_COPY(PetHandler) + ~PetHandler(); + void move(const int x, const int y) const override final; diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index bf246b39e..70139cd4a 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -53,6 +53,11 @@ PlayerHandler::PlayerHandler() : playerHandler = this; } +PlayerHandler::~PlayerHandler() +{ + playerHandler = nullptr; +} + void PlayerHandler::attack(const BeingId id, const Keep keep) const { diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index e205ba914..898a03057 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -35,6 +35,8 @@ class PlayerHandler final : public Ea::PlayerHandler A_DELETE_COPY(PlayerHandler) + ~PlayerHandler(); + void attack(const BeingId id, const Keep keep) const override final; void stopAttack() const override final; diff --git a/src/net/tmwa/questhandler.cpp b/src/net/tmwa/questhandler.cpp index e4c3c9def..1acc60740 100644 --- a/src/net/tmwa/questhandler.cpp +++ b/src/net/tmwa/questhandler.cpp @@ -31,6 +31,11 @@ QuestHandler::QuestHandler() : questHandler = this; } +QuestHandler::~QuestHandler() +{ + questHandler = nullptr; +} + void QuestHandler::setQeustActiveState(const int questId A_UNUSED, const bool active A_UNUSED) const { diff --git a/src/net/tmwa/questhandler.h b/src/net/tmwa/questhandler.h index c2a47f46f..4c56ef0c9 100644 --- a/src/net/tmwa/questhandler.h +++ b/src/net/tmwa/questhandler.h @@ -33,6 +33,8 @@ class QuestHandler final : public Net::QuestHandler A_DELETE_COPY(QuestHandler) + ~QuestHandler(); + void setQeustActiveState(const int questId, const bool active) const override final A_CONST; diff --git a/src/net/tmwa/roulettehandler.cpp b/src/net/tmwa/roulettehandler.cpp index 33e16b870..03b1afd8a 100644 --- a/src/net/tmwa/roulettehandler.cpp +++ b/src/net/tmwa/roulettehandler.cpp @@ -31,4 +31,9 @@ RouletteHandler::RouletteHandler() : rouletteHandler = this; } +RouletteHandler::~RouletteHandler() +{ + rouletteHandler = nullptr; +} + } // namespace TmwAthena diff --git a/src/net/tmwa/roulettehandler.h b/src/net/tmwa/roulettehandler.h index 990a46741..b575d3ca3 100644 --- a/src/net/tmwa/roulettehandler.h +++ b/src/net/tmwa/roulettehandler.h @@ -31,6 +31,8 @@ class RouletteHandler final : public Net::RouletteHandler RouletteHandler(); A_DELETE_COPY(RouletteHandler) + + ~RouletteHandler(); }; } // namespace TmwAthena diff --git a/src/net/tmwa/searchstorehandler.cpp b/src/net/tmwa/searchstorehandler.cpp index 54de0cc63..34f41fb8a 100644 --- a/src/net/tmwa/searchstorehandler.cpp +++ b/src/net/tmwa/searchstorehandler.cpp @@ -31,6 +31,11 @@ SearchStoreHandler::SearchStoreHandler() : searchStoreHandler = this; } +SearchStoreHandler::~SearchStoreHandler() +{ + searchStoreHandler = nullptr; +} + void SearchStoreHandler::search(const StoreSearchTypeT type A_UNUSED, const int minPrice A_UNUSED, const int maxPrice A_UNUSED, diff --git a/src/net/tmwa/searchstorehandler.h b/src/net/tmwa/searchstorehandler.h index ff192cd50..20112fcb1 100644 --- a/src/net/tmwa/searchstorehandler.h +++ b/src/net/tmwa/searchstorehandler.h @@ -32,6 +32,8 @@ class SearchStoreHandler final : public Net::SearchStoreHandler A_DELETE_COPY(SearchStoreHandler) + ~SearchStoreHandler(); + void search(const StoreSearchTypeT type, const int minPrice, const int maxPrice, diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp index 47d08ac62..9f8de7b2f 100644 --- a/src/net/tmwa/skillhandler.cpp +++ b/src/net/tmwa/skillhandler.cpp @@ -36,6 +36,11 @@ SkillHandler::SkillHandler() : skillHandler = this; } +SkillHandler::~SkillHandler() +{ + skillHandler = nullptr; +} + void SkillHandler::useBeing(const int id, const int level, const BeingId beingId) const { diff --git a/src/net/tmwa/skillhandler.h b/src/net/tmwa/skillhandler.h index 687336aa7..324774bea 100644 --- a/src/net/tmwa/skillhandler.h +++ b/src/net/tmwa/skillhandler.h @@ -35,6 +35,8 @@ class SkillHandler final : public Ea::SkillHandler A_DELETE_COPY(SkillHandler) + ~SkillHandler(); + void useBeing(const int id, const int level, const BeingId beingId) const override final; diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 10273c7a7..f82612bd0 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -44,6 +44,11 @@ TradeHandler::TradeHandler() : tradeHandler = this; } +TradeHandler::~TradeHandler() +{ + tradeHandler = nullptr; +} + void TradeHandler::request(const Being *const being) const { if (being == nullptr) diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h index 7a1f5204c..b8538f1bc 100644 --- a/src/net/tmwa/tradehandler.h +++ b/src/net/tmwa/tradehandler.h @@ -35,6 +35,8 @@ class TradeHandler final : public Ea::TradeHandler A_DELETE_COPY(TradeHandler) + ~TradeHandler(); + void request(const Being *const being) const override final; void respond(const bool accept) const override final; diff --git a/src/net/tmwa/vendinghandler.cpp b/src/net/tmwa/vendinghandler.cpp index 726dda217..30237cb0e 100644 --- a/src/net/tmwa/vendinghandler.cpp +++ b/src/net/tmwa/vendinghandler.cpp @@ -30,6 +30,11 @@ VendingHandler::VendingHandler() vendingHandler = this; } +VendingHandler::~VendingHandler() +{ + vendingHandler = nullptr; +} + void VendingHandler::close() const { } diff --git a/src/net/tmwa/vendinghandler.h b/src/net/tmwa/vendinghandler.h index 8091e0c7e..3af4a110b 100644 --- a/src/net/tmwa/vendinghandler.h +++ b/src/net/tmwa/vendinghandler.h @@ -33,6 +33,8 @@ class VendingHandler final : public Net::VendingHandler A_DELETE_COPY(VendingHandler) + ~VendingHandler(); + void close() const override final A_CONST; void open(const Being *const being) const override final A_CONST; |