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::~Bans()
{
}
}

View File

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

View File

@ -227,12 +227,4 @@ namespace Components
AntiCheat::CheckStartupTime();
#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);
CardTitles();
~CardTitles();
private:
static CClient * GetClientByIndex(std::uint32_t index);

View File

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

View File

@ -6,7 +6,6 @@ namespace Components
{
public:
Changelog();
~Changelog();
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
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;
public:
Chat();
~Chat();
private:
static Game::dvar_t** cg_chatHeight;

View File

@ -101,12 +101,4 @@ namespace Components
// Draw clantag before playername
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);
ClanTags();
~ClanTags();
private:
static std::string Tags[18];

View File

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

View File

@ -8,7 +8,7 @@ namespace Components
typedef void(Callback)(Game::gentity_s* entity);
ClientCommand();
~ClientCommand();
static void Add(const char* name, Utils::Slot<Callback> callback);
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:
Params() {};
virtual ~Params() {};
virtual const char* get(size_t index) = 0;
virtual size_t length() = 0;
@ -48,7 +49,6 @@ namespace Components
typedef void(Callback)(Command::Params* params);
Command();
~Command();
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:
Dedicated();
~Dedicated();
static SteamID PlayerGuids[18][2];

View File

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

View File

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

View File

@ -120,8 +120,4 @@ namespace Components
Utils::Hook(0x570E0B, 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:
Elevators();
~Elevators();
private:
enum ElevatorSettings { DISABLED, ENABLED, EASY };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,6 @@ namespace Components
{
public:
ModList();
~ModList();
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::~MusicalTalent()
{
MusicalTalent::SoundAliasList.clear();
}
}

View File

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

View File

@ -403,11 +403,4 @@ namespace Components
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)();
Network();
~Network();
static unsigned short GetPort();

View File

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

View File

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

View File

@ -190,11 +190,4 @@ namespace Components
Network::Handle("playlistResponse", PlaylistReponse);
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)();
Playlist();
~Playlist();
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:
RCon();
~RCon();
private:
class Container

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,6 @@ namespace Components
{
public:
StartupMessages();
~StartupMessages();
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
Utils::Hook(0x682F7B, Stats::SaveStats, HOOK_CALL).install()->quick();
}
Stats::~Stats()
{
}
}

View File

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

View File

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

View File

@ -6,7 +6,6 @@ namespace Components
{
public:
StringTable();
~StringTable();
private:
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();
private:
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);
#endif
}
Zones::~Zones()
{
}
}
#pragma optimize( "", on )

View File

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