From 4e98d36bcb792008da3eb958e2b59bd320561e6d Mon Sep 17 00:00:00 2001 From: sere Date: Wed, 6 Nov 2024 19:01:54 +0400 Subject: [PATCH 1/2] Implement EclManager::Unload --- config/implemented.csv | 1 + config/stubbed.csv | 1 - src/EclManager.cpp | 9 +++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/implemented.csv b/config/implemented.csv index a55b6281..fa9a075a 100644 --- a/config/implemented.csv +++ b/config/implemented.csv @@ -89,6 +89,7 @@ th06::Controller::EnumGameControllersCb th06::EclManager::CallEclSub th06::EclManager::Load th06::EclManager::RunEcl +th06::EclManager::Unload th06::Ending::Ending th06::Ending::RegisterChain th06::Ending::AddedCallback diff --git a/config/stubbed.csv b/config/stubbed.csv index b559c470..c9a473f6 100644 --- a/config/stubbed.csv +++ b/config/stubbed.csv @@ -1,4 +1,3 @@ -th06::EclManager::Unload th06::AnmManager::DrawEndingRect th06::MidiOutput::OnTimerElapsed th06::MidiOutput::ParseFile diff --git a/src/EclManager.cpp b/src/EclManager.cpp index 2b1acfed..b8494d6a 100644 --- a/src/EclManager.cpp +++ b/src/EclManager.cpp @@ -1021,4 +1021,13 @@ ZunResult EclManager::RunEcl(Enemy *enemy) } } } + +void EclManager::Unload() +{ + if (eclFile != NULL) { + free(eclFile); + } + eclFile = NULL; + return; +} }; // namespace th06 From 94ceb89d8339d3a90139740882878798cdd07a53 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:04:52 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/EclManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EclManager.cpp b/src/EclManager.cpp index b8494d6a..52103f57 100644 --- a/src/EclManager.cpp +++ b/src/EclManager.cpp @@ -1024,7 +1024,8 @@ ZunResult EclManager::RunEcl(Enemy *enemy) void EclManager::Unload() { - if (eclFile != NULL) { + if (eclFile != NULL) + { free(eclFile); } eclFile = NULL;