You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/05/11 06:01:20 UTC

[29/32] git commit: Call release function

Call release function


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fcdd1609
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fcdd1609
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fcdd1609

Branch: refs/heads/jpeach/lua
Commit: fcdd1609b02a027c16aeb31a78087b7f7c466c8c
Parents: c34d3fc
Author: James Peach <jp...@apache.org>
Authored: Fri Apr 6 21:17:22 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu May 10 20:23:40 2012 -0700

----------------------------------------------------------------------
 plugins/lua/lua.cc |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fcdd1609/plugins/lua/lua.cc
----------------------------------------------------------------------
diff --git a/plugins/lua/lua.cc b/plugins/lua/lua.cc
index 20f0c95..2e9d536 100644
--- a/plugins/lua/lua.cc
+++ b/plugins/lua/lua.cc
@@ -107,6 +107,13 @@ void
 TSRemapDeleteInstance(void * ih)
 {
   lua_State * lua = (lua_State *)ih;
+
+  lua_getglobal(lua, "release");
+  if (lua_pcall(lua, 0, 1, 0) != 0) {
+    TSDebug("lua", "init failed: %s", lua_tostring(lua, -1));
+    lua_pop(lua, 1);
+  }
+
   lua_close(lua);
 }