From 5101e69367293d6d47bdb7383eabe7993e055050 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 23 Jul 2026 19:33:32 -0700 Subject: Make the cached controls static to the function. --- indra/newview/llscripteditorws.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'indra/newview/llscripteditorws.cpp') diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index 555affe9a1..17ebd03ed2 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -157,9 +157,6 @@ namespace return std::string(s); } - LLCachedControl* OPT_ENABLESCRIPTEDITORWS(nullptr); - LLCachedControl* OPT_TIGHTINTEGRATION(nullptr); - } class LLPublishedPrimListener : public LLVOInventoryListener @@ -223,20 +220,14 @@ LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::getServer() bool LLScriptEditorWSServer::isEnabled() { - if (!OPT_ENABLESCRIPTEDITORWS) - { - OPT_ENABLESCRIPTEDITORWS = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncEnable", false); - } - return *OPT_ENABLESCRIPTEDITORWS; + static LLCachedControl OPT_ENABLESCRIPTEDITORWS(gSavedSettings, "ExternalWebsocketSyncEnable", false); + return OPT_ENABLESCRIPTEDITORWS; } bool LLScriptEditorWSServer::isTightIntegration() { - if (!OPT_TIGHTINTEGRATION) - { - OPT_TIGHTINTEGRATION = new LLCachedControl(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); - } - return *OPT_TIGHTINTEGRATION; + static LLCachedControl OPT_TIGHTINTEGRATION(gSavedSettings, "ExternalWebsocketSyncTightIntegration", false); + return OPT_TIGHTINTEGRATION; } LLScriptEditorWSServer::ptr_t LLScriptEditorWSServer::ensureServerRunning() -- cgit v1.3