Skip to content

Commit 2c7167b

Browse files
committed
Fix
1 parent 7658adb commit 2c7167b

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/main/kotlin/com/nekiplay/hypixelcry/features/lua/LuaScript.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,10 +1251,7 @@ class LuaScript(val scriptName: String, private val luaManager: LuaManager) {
12511251
djlLibrary?.predictors?.clear()
12521252
djlLibrary?.inputShapes?.clear()
12531253
djlLibrary?.modelModes?.clear()
1254-
ffi?.loadedLibraries?.forEach { lib ->
1255-
lib.value.dispose()
1256-
}
1257-
ffi?.loadedLibraries?.clear()
1254+
ffi?.disposeLoadedLibraries()
12581255

12591256
commandDispatchers.clear()
12601257

src/main/kotlin/com/nekiplay/hypixelcry/features/lua/objects/misc/FFILib.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,4 +572,9 @@ class FFILib : LuaTable() {
572572
fun setDebugMode(enabled: Boolean) {
573573
debugMode.set(enabled)
574574
}
575+
576+
fun disposeLoadedLibraries() {
577+
loadedLibraries.forEach { it.value.dispose() }
578+
loadedLibraries.clear()
579+
}
575580
}

0 commit comments

Comments
 (0)