mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
05778fbe6f
When mlua module is loaded from a non-main coroutine we store a reference to it to use later. If the coroutine is destroyed by GC we can pass a wrong pointer to Lua that will trigger a segfault. Instead, set main_state as Option and use current (active) state if needed. Relates to #479