mlua-rs / rlua

High level Lua bindings to Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak when using system-luajit

Jspa2 opened this issue · comments

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

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).

This has been released in 0.19.8.