Skip to content

Commit 2b78dfe

Browse files
committed
fix: gracefully release plugin when game is shutting down.
Before, game would shutdown but eventually crash when attempting to dispose of plugin.
1 parent 6fffca4 commit 2b78dfe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- gracefully release plugin when game is shutting down.
810

911
------------------------
1012

src/HttpClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ void HttpClient::load(const RED4ext::Sdk* p_sdk,
156156
HttpClient::stop();
157157
return true;
158158
};
159-
init.OnUpdate = nullptr;
160-
init.OnExit = nullptr;
159+
shutdown.OnUpdate = nullptr;
160+
shutdown.OnExit = nullptr;
161161
p_sdk->gameStates->Add(p_handle, Red::EGameStateType::Initialization, &init);
162162
p_sdk->gameStates->Add(p_handle, Red::EGameStateType::Shutdown, &shutdown);
163163
}

0 commit comments

Comments
 (0)