util-src/lsignal.c

changeset 2792
1b14388f1512
parent 2791
e23b642bdfd1
child 2811
11df731e1b87
--- a/util-src/lsignal.c	Sun Jan 10 00:31:38 2010 +0000
+++ b/util-src/lsignal.c	Sun Jan 10 03:54:29 2010 +0000
@@ -165,6 +165,9 @@
 
 static void sighook(lua_State *L, lua_Debug *ar)
 {
+  /* restore the old hook */
+  lua_sethook(L, Hsig, Hmask, Hcount);
+
   lua_pushstring(L, LUA_SIGNAL);
   lua_gettable(L, LUA_REGISTRYINDEX);
 
@@ -180,8 +183,6 @@
 
   lua_pop(L, 1); /* pop lua_signal table */
 
-  /* restore the old hook */
-  lua_sethook(L, Hsig, Hmask, Hcount);
 }
 
 static void handle(int sig)

mercurial