diff options
| author | amelia squires <[email protected]> | 2025-09-27 04:11:49 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2025-09-27 04:11:49 -0500 |
| commit | e3a798740c2d64d0ac0dd4a08ebfec9d5a1c3cf8 (patch) | |
| tree | 4fdf70facae0efe392a740438f15c85758c7f9c2 /src/thread.c | |
| parent | 6acf870551b48679cc5c4d430502f1f8a719eafd (diff) | |
leaks and memory fixes
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/thread.c b/src/thread.c index bb412ba..48ddba1 100644 --- a/src/thread.c +++ b/src/thread.c @@ -232,6 +232,9 @@ int _thread_await(lua_State* L){ lua_settop(info->L, ot);
}
+ lua_pushnil(L);
+ lua_setglobal(L, "_locals");
+
return info->return_count;
}
@@ -492,9 +495,11 @@ int l_buffer(lua_State* L){ luaI_tsetcf(L, meta_idx, "__index", l_buffer_index);
luaI_tsetcf(L, meta_idx, "__gc", l_buffer_gc);
- lua_getmetatable(L, 1);
- int idx = lua_gettop(L);
- luaI_tsetnil(L, idx, "__gc");
+ if(use != 0){
+ lua_getmetatable(L, 1);
+ int idx = lua_gettop(L);
+ luaI_tsetnil(L, idx, "__gc");
+ }
lua_pushvalue(L, meta_idx);
lua_setmetatable(L, buffer_idx);
|
