diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LuaHttp.cc | 4 | ||||
-rw-r--r-- | lib/LuaTask.cc | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/LuaHttp.cc b/lib/LuaHttp.cc index 2cd13f9..fde40c3 100644 --- a/lib/LuaHttp.cc +++ b/lib/LuaHttp.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: LuaHttp.cc,v 1.24 2008-01-21 17:22:41 pixel Exp $ */ +/* $Id: LuaHttp.cc,v 1.25 2008-01-23 17:41:10 pixel Exp $ */ #include "Domain.h" #include "LuaHttp.h" @@ -415,7 +415,7 @@ void LuaDomain::Do(const HttpRequest & req, HttpResponse * res) throw (GeneralEx LuaHttpResponse r(res); r.push(L); - res->builder = new LuaTask(L, 2); + res->builder = new LuaTask(L, 2, true); } int LuaDomain::max_id = 1; diff --git a/lib/LuaTask.cc b/lib/LuaTask.cc index 0acd392..12f1db5 100644 --- a/lib/LuaTask.cc +++ b/lib/LuaTask.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: LuaTask.cc,v 1.25 2008-01-22 10:51:18 pixel Exp $ */ +/* $Id: LuaTask.cc,v 1.26 2008-01-23 17:41:10 pixel Exp $ */ #include <LuaTask.h> #include <LuaHandle.h> @@ -34,7 +34,7 @@ htab * LuaTask::h = hcreate(1); -LuaTask::LuaTask(Lua * __L, const String & _cmd) : L(__L), cmd(_cmd), nargs(0), c(0), b(0) { +LuaTask::LuaTask(Lua * __L, const String & _cmd, bool _destroy_VM) : L(__L), cmd(_cmd), nargs(0), c(0), b(0), destroy_VM(_destroy_VM) { LuaTask * top = gettop(); if (top) { @@ -46,7 +46,7 @@ LuaTask::LuaTask(Lua * __L, const String & _cmd) : L(__L), cmd(_cmd), nargs(0), stacktop = L->gettop() + 1; } -LuaTask::LuaTask(Lua * __L, int _nargs) throw (GeneralException) : L(__L), cmd(""), nargs(_nargs), c(0), b(0) { +LuaTask::LuaTask(Lua * __L, int _nargs, bool _destroy_VM) throw (GeneralException) : L(__L), cmd(""), nargs(_nargs), c(0), b(0), destroy_VM(_destroy_VM) { if (gettop()) throw GeneralException("Can't run a stack-based LuaTask when there are other tasks waiting."); @@ -59,6 +59,8 @@ LuaTask::~LuaTask() { if (gettop() == this) { settop(0); } + if (destroy_VM) + delete L; } LuaTask * LuaTask::gettop() { |