From 98946406216a717f972371f38325b95fa813d96c Mon Sep 17 00:00:00 2001 From: Citrine Date: Tue, 20 Feb 2024 17:37:12 -0800 Subject: [PATCH] fix(barwidgets): only SafeWrapFunc Initialize() once Previously, Initialize() was wrapped dozens of times for each widget. --- luaui/barwidgets.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/luaui/barwidgets.lua b/luaui/barwidgets.lua index 52c742e00bb..12c77322724 100644 --- a/luaui/barwidgets.lua +++ b/luaui/barwidgets.lua @@ -836,9 +836,10 @@ local function SafeWrapWidget(widget) if widget[ciName] then widget[ciName] = SafeWrapFunc(widget[ciName], ciName) end - if widget.Initialize then - widget.Initialize = SafeWrapFunc(widget.Initialize, 'Initialize') - end + end + + if widget.Initialize then + widget.Initialize = SafeWrapFunc(widget.Initialize, 'Initialize') end end