Fix refcount logic & duplicate unhook checking.
commit8f95b3c7d3ed9fc736fd2cfdfd9cfb3d075e3438
authorRui Guo <firemeteor.guo@gmail.com>
Fri, 12 Jun 2009 14:22:58 +0000 (12 22:22 +0800)
committerRui Guo <firemeteor.guo@gmail.com>
Fri, 12 Jun 2009 14:22:58 +0000 (12 22:22 +0800)
tree5fa4068f9e4d4354ed0d4d8b1c5992ceca27fabc
parentf69e5829f6882dffb09be510c0eedeaeece59d1f
Fix refcount logic & duplicate unhook checking.

1. LuaFuncKey() now increase the ref count when asked to, but never decrease
   the ref count. It may return LUA_UNREF if an entry is not found but asked
   not to add it.
2. LuaCheckHandler never decreases ref count and record function name only
   for mapped entry.
3. Require to provide the function name on unhook, if the function could not
   be resolved to key, do not proceed.
src/lua.c
src/scripts/cmdcallback.lua