Skip to content

Initialize GameInteractor before SaveManager so it can correctly set up a hook#3535

Merged
garrettjoecox merged 1 commit intoHarbourMasters:develop-macreadyfrom
garrettjoecox:fix-save-manager-on-exit
Dec 18, 2023
Merged

Initialize GameInteractor before SaveManager so it can correctly set up a hook#3535
garrettjoecox merged 1 commit intoHarbourMasters:develop-macreadyfrom
garrettjoecox:fix-save-manager-on-exit

Conversation

@garrettjoecox
Copy link
Contributor

@garrettjoecox garrettjoecox commented Dec 18, 2023

Near the beginning of SaveManager's constructor is the following:

GameInteractor::Instance->RegisterGameHook<GameInteractor::OnExitGame>([this](uint32_t fileNum) { ThreadPoolWait(); });

However, the GameInteractor::Instance isn't initialized till after the SaveManager constructor. I'm not really sure why this doesn't crash, but could be the source of one of our relatively new issues (save corruptions or crash on soft resets, etc)

Build Artifacts

@garrettjoecox garrettjoecox changed the base branch from develop to develop-macready December 18, 2023 02:50
@garrettjoecox garrettjoecox merged commit b5caf33 into HarbourMasters:develop-macready Dec 18, 2023
@garrettjoecox garrettjoecox deleted the fix-save-manager-on-exit branch March 4, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants