summaryrefslogtreecommitdiff
path: root/src/table.rs
diff options
context:
space:
mode:
authorkyren <kerriganw@gmail.com>2017-12-04 00:15:20 -0500
committerkyren <kerriganw@gmail.com>2017-12-04 00:15:20 -0500
commitd76935e68381c990f96d3a36d9640713c7165941 (patch)
tree73a4630177f73c284ef7a1080791ad6b4b839f54 /src/table.rs
parentd0ff10b528ca071d94ab92440a2328df5082ceb0 (diff)
downloadmlua-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.rs5
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(())
})
}