alibaba/wax

频繁的释放被打补丁的程序的时候在wax_gc的cleanupUnusedObject里会存在崩溃的问题

Closed this issue · 2 comments

- (void)btnClick
{
    /**
     *  此处测试频繁释放被打补丁的对象
     *  发现会存在崩溃的问题
     */
    if (self.ocView) {
        [self.ocView removeFromSuperview];
        self.ocView = nil;
    }
    else {
        self.ocView = [[OCView alloc] initWithFrame:self.view.bounds];
        [self.view addSubview:self.ocView];
        [self.view bringSubviewToFront:self.button];
    }
}

lua:
================================
waxClass{"OCView",UIView}

function initWithFrame(self,frame)
    print 'view init'
    self = super:initWithFrame(frame)
    if self ~= nil then
        self:setBackgroundColor(UIColor:blueColor())
    end
    return self
end
===============================

When you want to call super's method, please call self.super:method().

function initWithFrame(self,frame)
    print 'view init'
    self = self.super:initWithFrame(frame)
    -- self = super:initWithFrame(frame)
    if self ~= nil then
        self:setBackgroundColor(UIColor:blueColor())
    end
    return self
end

原来如此 多谢!