diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/BLua.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/BLua.h b/includes/BLua.h index d0541f6..b195ef3 100644 --- a/includes/BLua.h +++ b/includes/BLua.h @@ -47,7 +47,7 @@ template<class T> class LuaObject : public LuaObjectBase { public: LuaObject(T * obj) : m_obj(obj) { } - virtual void destroy() override { if (!isDetached() && m_obj) delete m_obj; detach(); } + virtual void destroy() override { if (!isDetached() && m_obj) { m_obj->cleanup(); delete m_obj; } detach(); } T * getObj() { return m_obj; } virtual Task * spawnCollector() override { return isDetached() ? NULL : new DeferredCollector<T>(m_obj); } private: |