Remove unnecessary deconstructors

This commit is contained in:
FutureRave 2022-03-16 00:44:59 +00:00
parent 3982dfe5cc
commit 809e66cdb1
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955
51 changed files with 6 additions and 175 deletions

View File

@ -274,9 +274,4 @@ namespace Components
Bans::LoadBans(&list); Bans::LoadBans(&list);
}); });
} }
Bans::~Bans()
{
}
} }

View File

@ -8,7 +8,6 @@ namespace Components
typedef std::pair<SteamID, Game::netIP_t> Entry; typedef std::pair<SteamID, Game::netIP_t> Entry;
Bans(); Bans();
~Bans();
static void BanClientNum(int num, const std::string& reason); static void BanClientNum(int num, const std::string& reason);
static void UnbanClient(SteamID id); static void UnbanClient(SteamID id);

View File

@ -227,12 +227,4 @@ namespace Components
AntiCheat::CheckStartupTime(); AntiCheat::CheckStartupTime();
#endif #endif
} }
CardTitles::~CardTitles()
{
for (int i = 0; i < ARRAYSIZE(CardTitles::CustomTitles); ++i)
{
CardTitles::CustomTitles[i].clear();
}
}
} }

View File

@ -60,7 +60,6 @@ namespace Components
static void ParseCustomTitles(const char * msg); static void ParseCustomTitles(const char * msg);
CardTitles(); CardTitles();
~CardTitles();
private: private:
static CClient * GetClientByIndex(std::uint32_t index); static CClient * GetClientByIndex(std::uint32_t index);

View File

@ -60,12 +60,4 @@ namespace Components
Scheduler::OnFrameAsync(AntiCheat::QuickCodeScanner1); Scheduler::OnFrameAsync(AntiCheat::QuickCodeScanner1);
#endif #endif
} }
Changelog::~Changelog()
{
{
std::lock_guard<std::mutex> _(Changelog::Mutex);
Changelog::Lines.clear();
}
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
Changelog(); Changelog();
~Changelog();
static void LoadChangelog(); static void LoadChangelog();

View File

@ -328,9 +328,4 @@ namespace Components
// Change logic that does word splitting with new lines for chat messages to support fonticons // Change logic that does word splitting with new lines for chat messages to support fonticons
Utils::Hook(0x592E10, CG_AddToTeamChat_Stub, HOOK_JUMP).install()->quick(); Utils::Hook(0x592E10, CG_AddToTeamChat_Stub, HOOK_JUMP).install()->quick();
} }
Chat::~Chat()
{
Chat::MuteList.clear();
}
} }

View File

@ -7,7 +7,6 @@ namespace Components
static constexpr auto FONT_ICON_CHAT_WIDTH_CALCULATION_MULTIPLIER = 2.0f; static constexpr auto FONT_ICON_CHAT_WIDTH_CALCULATION_MULTIPLIER = 2.0f;
public: public:
Chat(); Chat();
~Chat();
private: private:
static Game::dvar_t** cg_chatHeight; static Game::dvar_t** cg_chatHeight;

View File

@ -101,12 +101,4 @@ namespace Components
// Draw clantag before playername // Draw clantag before playername
Utils::Hook(0x591242, ClanTags::DrawPlayerNameOnScoreboard).install()->quick(); Utils::Hook(0x591242, ClanTags::DrawPlayerNameOnScoreboard).install()->quick();
} }
ClanTags::~ClanTags()
{
for (int i = 0; i < ARRAYSIZE(ClanTags::Tags); ++i)
{
ClanTags::Tags[i].clear();
}
}
} }

View File

@ -10,7 +10,6 @@ namespace Components
static const char* GetUserClantag(std::uint32_t clientnum, const char * playername); static const char* GetUserClantag(std::uint32_t clientnum, const char * playername);
ClanTags(); ClanTags();
~ClanTags();
private: private:
static std::string Tags[18]; static std::string Tags[18];

View File

@ -309,9 +309,4 @@ namespace Components
ClientCommand::AddCheatCommands(); ClientCommand::AddCheatCommands();
ClientCommand::AddScriptFunctions(); ClientCommand::AddScriptFunctions();
} }
ClientCommand::~ClientCommand()
{
ClientCommand::FunctionMap.clear();
}
} }

View File

@ -8,7 +8,7 @@ namespace Components
typedef void(Callback)(Game::gentity_s* entity); typedef void(Callback)(Game::gentity_s* entity);
ClientCommand(); ClientCommand();
~ClientCommand();
static void Add(const char* name, Utils::Slot<Callback> callback); static void Add(const char* name, Utils::Slot<Callback> callback);
static bool CheatsOk(const Game::gentity_s* ent); static bool CheatsOk(const Game::gentity_s* ent);

View File

@ -168,10 +168,4 @@ namespace Components
} }
}); });
} }
Command::~Command()
{
Command::FunctionMap.clear();
Command::FunctionMapSV.clear();
}
} }

View File

@ -10,6 +10,7 @@ namespace Components
public: public:
Params() {}; Params() {};
virtual ~Params() {}; virtual ~Params() {};
virtual const char* get(size_t index) = 0; virtual const char* get(size_t index) = 0;
virtual size_t length() = 0; virtual size_t length() = 0;
@ -48,7 +49,6 @@ namespace Components
typedef void(Callback)(Command::Params* params); typedef void(Callback)(Command::Params* params);
Command(); Command();
~Command();
static Game::cmd_function_t* Allocate(); static Game::cmd_function_t* Allocate();

View File

@ -519,9 +519,4 @@ namespace Components
} }
}); });
} }
Dedicated::~Dedicated()
{
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
Dedicated(); Dedicated();
~Dedicated();
static SteamID PlayerGuids[18][2]; static SteamID PlayerGuids[18][2];

View File

@ -95,11 +95,6 @@ namespace Components
#endif #endif
} }
Discovery::~Discovery()
{
}
void Discovery::preDestroy() void Discovery::preDestroy()
{ {
Discovery::IsPerforming = false; Discovery::IsPerforming = false;

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
Discovery(); Discovery();
~Discovery();
void preDestroy() override; void preDestroy() override;

View File

@ -120,8 +120,4 @@ namespace Components
Utils::Hook(0x570E0B, Elevators::PM_Trace_Hk, HOOK_CALL).install()->quick(); Utils::Hook(0x570E0B, Elevators::PM_Trace_Hk, HOOK_CALL).install()->quick();
Utils::Hook(0x570D70, Elevators::PM_Trace_Hk, HOOK_CALL).install()->quick(); Utils::Hook(0x570D70, Elevators::PM_Trace_Hk, HOOK_CALL).install()->quick();
} }
Elevators::~Elevators()
{
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
Elevators(); Elevators();
~Elevators();
private: private:
enum ElevatorSettings { DISABLED, ENABLED, EASY }; enum ElevatorSettings { DISABLED, ENABLED, EASY };

View File

@ -622,9 +622,4 @@ namespace Components
}, HOOK_CALL).install()/*->quick()*/; }, HOOK_CALL).install()/*->quick()*/;
#endif #endif
} }
FastFiles::~FastFiles()
{
FastFiles::ZonePaths.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
FastFiles(); FastFiles();
~FastFiles();
static void AddZonePath(const std::string& path); static void AddZonePath(const std::string& path);
static std::string Current(); static std::string Current();

View File

@ -53,8 +53,4 @@ namespace Components
Flags::EnabledFlags.push_back("stdout"); Flags::EnabledFlags.push_back("stdout");
} }
} }
Flags::Flags()
{
}
} }

View File

@ -5,7 +5,7 @@ namespace Components
class Flags : public Component class Flags : public Component
{ {
public: public:
Flags(); Flags() = default;
static bool HasFlag(const std::string& flag); static bool HasFlag(const std::string& flag);

View File

@ -913,7 +913,6 @@ namespace Components
Menus::~Menus() Menus::~Menus()
{ {
Menus::CustomMenus.clear();
Menus::FreeEverything(); Menus::FreeEverything();
} }
} }

View File

@ -101,9 +101,4 @@ namespace Components
UIFeeder::Add(9.0f, ModList::GetItemCount, ModList::GetItemText, ModList::Select); UIFeeder::Add(9.0f, ModList::GetItemCount, ModList::GetItemText, ModList::Select);
} }
ModList::~ModList()
{
ModList::Mods.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
ModList(); ModList();
~ModList();
static void RunMod(const std::string& mod); static void RunMod(const std::string& mod);

View File

@ -39,9 +39,4 @@ namespace Components
MusicalTalent::Replace("music_mainmenu_mp", "hz_t_menumusic.mp3"); MusicalTalent::Replace("music_mainmenu_mp", "hz_t_menumusic.mp3");
} }
MusicalTalent::~MusicalTalent()
{
MusicalTalent::SoundAliasList.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
MusicalTalent(); MusicalTalent();
~MusicalTalent();
static void Replace(const std::string& sound, const char* file); static void Replace(const std::string& sound, const char* file);

View File

@ -403,11 +403,4 @@ namespace Components
Network::SendRaw(address, address.getString()); Network::SendRaw(address, address.getString());
}); });
} }
Network::~Network()
{
Network::SelectedPacket.clear();
Network::PacketHandlers.clear();
Network::StartupSignal.clear();
}
} }

View File

@ -52,7 +52,6 @@ namespace Components
typedef void(CallbackRaw)(); typedef void(CallbackRaw)();
Network(); Network();
~Network();
static unsigned short GetPort(); static unsigned short GetPort();

View File

@ -513,9 +513,4 @@ namespace Components
Friends::UpdateServer(address, info.get("hostname"), info.get("mapname")); Friends::UpdateServer(address, info.get("hostname"), info.get("mapname"));
}); });
} }
Party::~Party()
{
Party::LobbyMap.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
Party(); Party();
~Party();
static Network::Address Target(); static Network::Address Target();
static void Connect(Network::Address target); static void Connect(Network::Address target);

View File

@ -190,11 +190,4 @@ namespace Components
Network::Handle("playlistResponse", PlaylistReponse); Network::Handle("playlistResponse", PlaylistReponse);
Network::Handle("playlistInvalidPassword", PlaylistInvalidPassword); Network::Handle("playlistInvalidPassword", PlaylistInvalidPassword);
} }
Playlist::~Playlist()
{
Playlist::MapRelocation.clear();
Playlist::CurrentPlaylistBuffer.clear();
Playlist::ReceivedPlaylistBuffer.clear();
}
} }

View File

@ -8,7 +8,6 @@ namespace Components
typedef void(*Callback)(); typedef void(*Callback)();
Playlist(); Playlist();
~Playlist();
static void LoadPlaylist(); static void LoadPlaylist();

View File

@ -173,9 +173,4 @@ namespace Components
} }
}); });
} }
RCon::~RCon()
{
RCon::Password.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
RCon(); RCon();
~RCon();
private: private:
class Container class Container

View File

@ -705,14 +705,6 @@ namespace Components
Script::~Script() Script::~Script()
{ {
Script::ScriptName.clear();
Script::ScriptHandles.clear();
Script::ScriptNameStack.clear();
Script::ScriptFunctions.clear();
Script::ReplacedFunctions.clear();
Script::VMShutdownSignal.clear(); Script::VMShutdownSignal.clear();
Script::ScriptStorage.clear();
Script::ScriptBaseProgramNum.clear();
} }
} }

View File

@ -65,9 +65,4 @@ namespace Components
// Server command receive hook // Server command receive hook
Utils::Hook(0x59449F, ServerCommands::OnServerCommandStub).install()->quick(); Utils::Hook(0x59449F, ServerCommands::OnServerCommandStub).install()->quick();
} }
ServerCommands::~ServerCommands()
{
ServerCommands::Commands.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
ServerCommands(); ServerCommands();
~ServerCommands();
static void OnCommand(std::int32_t cmd, Utils::Slot<bool(Command::Params*)> cb); static void OnCommand(std::int32_t cmd, Utils::Slot<bool(Command::Params*)> cb);

View File

@ -879,16 +879,9 @@ namespace Components
} }
ServerList::~ServerList() ServerList::~ServerList()
{
ServerList::OnlineList.clear();
ServerList::OfflineList.clear();
ServerList::FavouriteList.clear();
ServerList::VisibleList.clear();
{ {
std::lock_guard<std::recursive_mutex> _(ServerList::RefreshContainer.mutex); std::lock_guard<std::recursive_mutex> _(ServerList::RefreshContainer.mutex);
ServerList::RefreshContainer.awatingList = false; ServerList::RefreshContainer.awatingList = false;
ServerList::RefreshContainer.servers.clear(); ServerList::RefreshContainer.servers.clear();
} }
}
} }

View File

@ -34,11 +34,6 @@ namespace Components
}); });
} }
StartupMessages::~StartupMessages()
{
StartupMessages::MessageList.clear();
}
void StartupMessages::AddMessage(const std::string& message) void StartupMessages::AddMessage(const std::string& message)
{ {
StartupMessages::MessageList.push_back(message); StartupMessages::MessageList.push_back(message);

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
StartupMessages(); StartupMessages();
~StartupMessages();
static void AddMessage(const std::string& message); static void AddMessage(const std::string& message);

View File

@ -107,9 +107,4 @@ namespace Components
// Write stats to mod folder if a mod is loaded // Write stats to mod folder if a mod is loaded
Utils::Hook(0x682F7B, Stats::SaveStats, HOOK_CALL).install()->quick(); Utils::Hook(0x682F7B, Stats::SaveStats, HOOK_CALL).install()->quick();
} }
Stats::~Stats()
{
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
Stats(); Stats();
~Stats();
static bool IsMaxLevel(); static bool IsMaxLevel();

View File

@ -76,9 +76,4 @@ namespace Components
return header; return header;
}); });
} }
StringTable::~StringTable()
{
StringTable::StringTableMap.clear();
}
} }

View File

@ -6,7 +6,6 @@ namespace Components
{ {
public: public:
StringTable(); StringTable();
~StringTable();
private: private:
static std::unordered_map<std::string, Game::StringTable*> StringTableMap; static std::unordered_map<std::string, Game::StringTable*> StringTableMap;

View File

@ -311,9 +311,4 @@ namespace Components
} }
}); });
} }
StructuredData::~StructuredData()
{
StructuredData::MemAllocator.clear();
}
} }

View File

@ -24,7 +24,6 @@ namespace Components
}; };
StructuredData(); StructuredData();
~StructuredData();
private: private:
static bool UpdateVersionOffsets(Game::StructuredDataDefSet *set, Game::StructuredDataBuffer *buffer, Game::StructuredDataDef *oldDef); static bool UpdateVersionOffsets(Game::StructuredDataDefSet *set, Game::StructuredDataBuffer *buffer, Game::StructuredDataDef *oldDef);

View File

@ -3696,10 +3696,5 @@ namespace Components
Utils::Hook::Set<WORD>(0x6B9602,0xCCCC); Utils::Hook::Set<WORD>(0x6B9602,0xCCCC);
#endif #endif
} }
Zones::~Zones()
{
}
} }
#pragma optimize( "", on ) #pragma optimize( "", on )

View File

@ -18,7 +18,6 @@ namespace Components
}; };
Zones(); Zones();
~Zones();
static void SetVersion(int version); static void SetVersion(int version);