mlua-rs / rlua

High level Lua bindings to Rust
Other
1.73k stars 115 forks source link

Memory leak when using system-luajit #292

Closed Jspa2 closed 10 months ago

Jspa2 commented 10 months ago

Bug description

When compiling rlua with the system-luajit feature, the Lua struct does not properly free its memory when it goes out of scope. This does not occur with other Lua implementations such as system-lua54.

Reproducible example

use rlua::Lua;

fn main() {
    loop {
        Lua::new();
    }
}

With system-luajit enabled, this example will cause the system to run out of memory.

System information

OpenBSD bsd.lan 7.4 GENERIC.MP#1397 amd64

jugglerchris commented 10 months ago

Thanks for the report! I believe I've fixed it in #293 - I'd appreciate it if you could check (either now or after it's merged).

jugglerchris commented 10 months ago

This has been released in 0.19.8.