tomaka / hlua

Rust library to interface with Lua
MIT License
507 stars 48 forks source link

Crash? #149

Open jD91mZM2 opened 7 years ago

jD91mZM2 commented 7 years ago
println!("Marker 1");
lua.set(
    "cmd",
    hlua::function1::<_, String, Vec<AnyLuaValue>>(
        move |args| {
            println!("Call");
            String::new()
        }
    )
);
println!("Marker 2");

Often, Call is never printed, and instead the program is terminated with a status of 1, without any information whatsoever. Not a usual panic. Just... dies. Using latest version from git, since that adds the Vec<AnyLuaValue> support.

Edit: Also the code in question is print(cmd("test"))
Edit 2: Just to clarify - the cmd function wants a vec. If it gets a string, it sometimes crashes and sometimes gives an empty vec.