summaryrefslogtreecommitdiff
path: root/src/table.rs
diff options
context:
space:
mode:
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(())
})
}