diff options
author | kyren <kerriganw@gmail.com> | 2017-12-04 00:15:20 -0500 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2017-12-04 00:15:20 -0500 |
commit | d76935e68381c990f96d3a36d9640713c7165941 (patch) | |
tree | 73a4630177f73c284ef7a1080791ad6b4b839f54 /src/table.rs | |
parent | d0ff10b528ca071d94ab92440a2328df5082ceb0 (diff) | |
download | mlua-d76935e68381c990f96d3a36d9640713c7165941.zip |
I *THINK* this might actually be it, is rlua 'm' safe now?
Diffstat (limited to 'src/table.rs')
-rw-r--r-- | src/table.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/table.rs b/src/table.rs index f4339b2..7347b7f 100644 --- a/src/table.rs +++ b/src/table.rs @@ -129,8 +129,9 @@ impl<'lua> Table<'lua> { lua.push_ref(lua.state, &self.0); lua.push_value(lua.state, key.to_lua(lua)?); lua.push_value(lua.state, value.to_lua(lua)?); - ffi::lua_rawset(lua.state, -3); - ffi::lua_pop(lua.state, 1); + protect_lua_call(lua.state, 3, 0, |state| { + ffi::lua_rawset(state, -3); + })?; Ok(()) }) } |