Prevent re-unregistering commands
authorMyhailo Danylenko <isbear@ukrpost.net>
Mon, 12 Apr 2010 00:41:23 +0300
changeset 110 bd9f24178d67
parent 109 2d2111cb5109
child 111 5bcdb71ef2f2
Prevent re-unregistering commands
lua.c
--- a/lua.c	Mon Apr 12 00:29:44 2010 +0300
+++ b/lua.c	Mon Apr 12 00:41:23 2010 +0300
@@ -1094,6 +1094,8 @@
 	lua_rawgeti (L, LUA_REGISTRYINDEX, cb -> nameref);
 	name = lua_tostring (L, -1);
 	cmd_del (name);
+	luaL_unref (L, LUA_REGISTRYINDEX, cb -> nameref);
+	cb -> nameref = LUA_NOREF;
 	lua_pop (L, 1);
 #endif
 }