From 90d599cac49fa08f225abc86efd58f35d497c4e5 Mon Sep 17 00:00:00 2001 From: sprunk Date: Sat, 30 Dec 2017 16:22:29 +0100 Subject: [PATCH] Prevent dangling weak link crashes. --- libs/chiliui/luamenu/chili/chili/controls/control.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/chiliui/luamenu/chili/chili/controls/control.lua b/libs/chiliui/luamenu/chili/chili/controls/control.lua index 664c8f4d3..1b02609e8 100644 --- a/libs/chiliui/luamenu/chili/chili/controls/control.lua +++ b/libs/chiliui/luamenu/chili/chili/controls/control.lua @@ -304,7 +304,7 @@ function Control:GetRelativeBox(savespace) end local p = self.parent - if (not p) then + if not p or not UnlinkSafe(p) then return t end @@ -921,7 +921,7 @@ end function Control:_UpdateOwnDList() - if not self.parent then return end + if not self.parent or not UnlinkSafe(self.parent) then return end if not self:IsInView() then return end if not self.useDLists then return end @@ -931,7 +931,7 @@ end function Control:_UpdateChildrenDList() - if not self.parent then return end + if not self.parent or not UnlinkSafe(self.parent) then return end if not self:IsInView() then return end if self:InheritsFrom("scrollpanel") and not self._cantUseRTT then @@ -948,7 +948,7 @@ end function Control:_UpdateAllDList() - if not self.parent then return end + if not self.parent or not UnlinkSafe(self.parent) then return end if not self:IsInView() then return end local RTT = self:_CheckIfRTTisAppreciated() @@ -1138,7 +1138,7 @@ end function Control:IsRectInView(x,y,w,h) - if (not self.parent) then + if not self.parent or not UnlinkSafe(self.parent) then return false end