From 6cbcf027341c28b07dc40c2b41b6b96f87f5bd23 Mon Sep 17 00:00:00 2001 From: batrick Date: Mon, 28 May 2012 21:48:54 +0000 Subject: [PATCH] Get the closure from the library, don't make a new one. --- nse_dnet.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nse_dnet.cc b/nse_dnet.cc index 56abf893c..22590e00d 100644 --- a/nse_dnet.cc +++ b/nse_dnet.cc @@ -268,7 +268,7 @@ static int ip_send (lua_State *L) memcpy(eth.dstmac, dstmac, sizeof(eth.dstmac)); /* close any current ethernet associated with this userdata */ - lua_pushcfunction(L, ethernet_close); + lua_getfield(L, 1, "ethernet_close"); lua_pushvalue(L, 1); lua_call(L, 1, 0); @@ -294,10 +294,10 @@ static int gc (lua_State *L) { nseU_checkudata(L, 1, DNET_METATABLE, "dnet"); - lua_pushcfunction(L, ip_close); + lua_getfield(L, 1, "ip_close"); lua_pushvalue(L, 1); lua_call(L, 1, 0); - lua_pushcfunction(L, ethernet_close); + lua_getfield(L, 1, "ethernet_close"); lua_pushvalue(L, 1); lua_call(L, 1, 0);