Skip to content

Commit

Permalink
Merge branch '2.0Dev' into Main
Browse files Browse the repository at this point in the history
  • Loading branch information
narknon committed Jan 3, 2023
2 parents 73be40b + ce69f1a commit d691711
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dependencies/Unreal
2 changes: 1 addition & 1 deletion include/Mod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace RC
auto prepare_mod(const LuaMadeSimple::Lua& lua) -> void;
auto start_mod() -> void;
auto is_started() const -> bool;
auto uninstall() const -> void;
auto uninstall() -> void;

auto lua() const -> const LuaMadeSimple::Lua&;
auto main_lua() const -> const LuaMadeSimple::Lua*;
Expand Down
11 changes: 9 additions & 2 deletions src/Mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2165,9 +2165,16 @@ No overload found for function 'FPackageName:IsValidLongPackageName'.
return m_is_started;
}

auto Mod::uninstall() const -> void
auto Mod::uninstall() -> void
{
Output::send(STR("Stopping mod '{}' for uninstall\n"), m_mod_name);

if (m_async_thread.joinable())
{
m_async_thread.request_stop();
m_async_thread.join();
}

if (m_hook_lua.size() > 0)
{
for (auto lua : m_hook_lua)
Expand Down Expand Up @@ -2479,7 +2486,7 @@ No overload found for function 'FPackageName:IsValidLongPackageName'.

auto Mod::update_async() -> void
{
for (m_processing_events = true; m_processing_events;)
for (m_processing_events = true; m_processing_events && !m_async_thread.get_stop_token().stop_requested();)
{
if (m_pause_events_processing) { continue; }

Expand Down
2 changes: 1 addition & 1 deletion src/UE4SSProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ namespace RC

auto UE4SSProgram::uninstall_mods() -> void
{
for (const auto& mod : m_mods)
for (auto& mod : m_mods)
{
// Remove any actions, or we'll get an internal error as the lua ref won't be valid
mod->clear_delayed_actions();
Expand Down

0 comments on commit d691711

Please sign in to comment.