Skip to content

Commit 07e2618

Browse files
committed
fix: reset DebugEngine shared pointer when unload
1 parent 50d02de commit 07e2618

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/lse/Entry.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ bool LegacyScriptEngine::load() {
125125
}
126126
}
127127

128+
bool LegacyScriptEngine::unload() {
129+
DebugEngine.reset();
130+
return true;
131+
}
132+
128133
Config const& LegacyScriptEngine::getConfig() { return config; }
129134

130135
PluginManager& LegacyScriptEngine::getManager() {

src/lse/Entry.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

3+
#include "ll/api/mod/NativeMod.h"
34
#include "lse/Config.h"
45
#include "lse/PluginManager.h"
5-
#include "ll/api/mod/NativeMod.h"
66

77
namespace lse {
88

@@ -24,6 +24,8 @@ class LegacyScriptEngine {
2424

2525
bool enable();
2626

27+
bool unload();
28+
2729
private:
2830
ll::mod::NativeMod& mSelf;
2931
Config config; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)

0 commit comments

Comments
 (0)