Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ref = {num = 1}
- me.ref = ref
- ref = nil
- print(me.ref.num)
- >> 1
- -- BAD!!!
- local ref = {num = 1, Remove = function(self) self.valid = false end, IsValid = function() return true end}
- me.ref = ref
- ref:Remove()
- print(me.ref:IsValid())
- >> false
- -- good solution
Advertisement
Add Comment
Please, Sign In to add comment