From c9998d3abfb75e64b92ece68fb6f9ffc696ed1b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 3 Nov 2020 18:54:52 +0100 Subject: [PATCH] ksys/gdt: Make ~Manager the key function to help with dtor matching Make syncData a pure virtual function that is overridden in Manager to turn the destructor into the key function. Otherwise, the GOT would be used to load the vtable pointer until syncData is implemented, which is quite inconvenient. --- src/KingSystem/GameData/gdtManager.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/KingSystem/GameData/gdtManager.h b/src/KingSystem/GameData/gdtManager.h index b691eff3..b723f3dc 100644 --- a/src/KingSystem/GameData/gdtManager.h +++ b/src/KingSystem/GameData/gdtManager.h @@ -17,8 +17,8 @@ inline IManager::~IManager() = default; /// GameDataMgr communication. class ManagerCom { public: - virtual const char* getName() const { return "GameData"; } - virtual void syncData(); + virtual const char* getName() const = 0; + virtual void syncData() = 0; void* _8 = nullptr; void* _10 = nullptr; @@ -29,7 +29,9 @@ KSYS_CHECK_SIZE_NX150(ManagerCom, 0x18); class Manager : public IManager, public ManagerCom { SEAD_SINGLETON_DISPOSER(Manager) Manager(); - virtual ~Manager(); + ~Manager() override; + const char* getName() const override { return "GameData"; } + void syncData() override; public: sead::Heap* getGameDataHeap() const { return mGameDataHeap; }