q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1392518ec2be9ddd115662d08660d40958d8cb54
commit 1392518ec2be9ddd115662d08660d40958d8cb54 Author: Daniel Kolesa <[email protected]> Date: Mon Mar 2 16:02:23 2015 +0000 elua: readonly object __dtor support --- src/scripts/elua/core/util.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scripts/elua/core/util.lua b/src/scripts/elua/core/util.lua index 99a7203..246ea6c 100644 --- a/src/scripts/elua/core/util.lua +++ b/src/scripts/elua/core/util.lua @@ -100,6 +100,11 @@ M.Object = { local newproxy = newproxy +local robj_gc = function(px) + local dtor = px.__dtor + if dtor then dtor(px) end +end + M.Readonly_Object = M.Object:clone {} M.Readonly_Object.__call = function(self, ...) local r = newproxy(true) @@ -107,6 +112,9 @@ M.Readonly_Object.__call = function(self, ...) rmt.__index = self rmt.__tostring = self.__tostring rmt.__metatable = false + if self.__enable_dtor then + rmt.__gc = robj_gc + end if self.__ctor then return r, self.__ctor(r, rmt, ...) end return r end --
