From ff9046f7092dfef012f39785131803e359394660 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 6 Aug 2013 03:43:16 +0200 Subject: Using shared_ptr instead of rolling our own system, making it more pretty. --- src/BLua.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/BLua.cc') diff --git a/src/BLua.cc b/src/BLua.cc index 247a8ab..e8c5ab6 100644 --- a/src/BLua.cc +++ b/src/BLua.cc @@ -1,3 +1,4 @@ +#include #include #include "BLua.h" #include "Printer.h" @@ -97,15 +98,14 @@ int Balau::LuaStatics::dumpvars(lua_State * __L) { IO s(new Buffer()); L.dumpvars(h, prefix); Task * t = new CopyTask(s, h); - Events::TaskEvent * evt = new Events::TaskEvent(t); + std::shared_ptr evt(new Events::TaskEvent(t)); return L.yield(Future([evt, s]() mutable { for (;;) { if (evt->gotSignal()) { evt->ack(); - delete evt; s->close(); } else { - Task::operationYield(evt, Task::INTERRUPTIBLE); + Task::operationYield(evt.get(), Task::INTERRUPTIBLE); } } return 0; -- cgit v1.2.3