Update class.lua
This commit is contained in:
parent
d0864754bc
commit
0467c0cad6
1 changed files with 9 additions and 0 deletions
|
|
@ -181,6 +181,10 @@ function module.init(shared)
|
||||||
rawset(self,"__parent",parent);
|
rawset(self,"__parent",parent);
|
||||||
mount(item,parent)
|
mount(item,parent)
|
||||||
end
|
end
|
||||||
|
-- prevent gc
|
||||||
|
((type(object) == "table" and object.__object) or object):GetPropertyChamgedSignal "ClassName":Connect(function()
|
||||||
|
return item;
|
||||||
|
end);
|
||||||
return self;
|
return self;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -208,6 +212,10 @@ function module.init(shared)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- prevnet gc
|
||||||
|
((type(object) == "table" and object.__object) or object):GetPropertyChamgedSignal "ClassName":Connect(function()
|
||||||
|
return item;
|
||||||
|
end);
|
||||||
if lastObject then -- remove old instance
|
if lastObject then -- remove old instance
|
||||||
self:Destroy(lastObject);
|
self:Destroy(lastObject);
|
||||||
end
|
end
|
||||||
|
|
@ -227,6 +235,7 @@ function module.init(shared)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
self = nil;
|
||||||
end
|
end
|
||||||
|
|
||||||
--- link to new
|
--- link to new
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue