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.
This commit is contained in:
Léo Lam 2020-11-03 18:54:52 +01:00
parent 835e11cb16
commit c9998d3abf
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 5 additions and 3 deletions

View File

@ -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; }