From 0bf94569e3835207ed10a1c29ce21952dfb1859c Mon Sep 17 00:00:00 2001 From: yeah-its-gloria <32610623+yeah-its-gloria@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:35:37 +0200 Subject: [PATCH] Adjust existing code to review before proceeding --- .gitignore | 2 -- src/network/social/loader.cpp | 2 +- src/network/social/loader.h | 5 ++--- src/os/windows/social_win.cpp | 3 ++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0461ead471..4eed0f0e47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -/.cache /.vs -/.vscode /build* CMakeSettings.json docs/aidocs/* diff --git a/src/network/social/loader.cpp b/src/network/social/loader.cpp index c4dea7126f..31ceab9536 100644 --- a/src/network/social/loader.cpp +++ b/src/network/social/loader.cpp @@ -5,7 +5,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file network_chat_gui.cpp GUI for handling chat messages. */ +/** @file loader.cpp Loader code for social plugins. */ #include "../../stdafx.h" #include "../network_func.h" diff --git a/src/network/social/loader.h b/src/network/social/loader.h index 2eb6121513..65a3e0d1dc 100644 --- a/src/network/social/loader.h +++ b/src/network/social/loader.h @@ -5,12 +5,11 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file network_client.h Client part of the network protocol. */ +/** @file loader.h Social plugin loader class. */ #ifndef NETWORK_SOCIAL_LOADER_H #define NETWORK_SOCIAL_LOADER_H -#include "../../core/alloc_type.hpp" #include "social_api.h" struct SocialPlatformPlugin { @@ -24,7 +23,7 @@ struct SocialPlatformPlugin { void* userdata; }; -class SocialPlatformLoader : public ZeroedMemoryAllocator { +class SocialPlatformLoader { public: void Shutdown(); void RunDispatch(); diff --git a/src/os/windows/social_win.cpp b/src/os/windows/social_win.cpp index 26b6cce29f..4cc09cd4ca 100644 --- a/src/os/windows/social_win.cpp +++ b/src/os/windows/social_win.cpp @@ -5,7 +5,7 @@ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see . */ -/** @file survey_win.cpp Windows implementation of OS-specific survey information. */ +/** @file social_win.cpp Win32 backing implementation for social plugin loading. */ #include "../../stdafx.h" @@ -43,6 +43,7 @@ void LoadSocialPlatforms(std::vector& plugins) { if (plugin.initialize == nullptr || plugin.shutdown == nullptr || plugin.dispatch == nullptr || plugin.newState == nullptr) { FreeLibrary(library); + continue; } plugins.push_back(plugin);