summaryrefslogtreecommitdiff
path: root/indra/newview/tests
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-06-17 11:18:09 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-06-17 11:18:09 -0400
commit5b6a5c757deaba3c2b361eb49f2e61630fe3eb47 (patch)
tree14e69fcce05d56625bd16082d54f55909c33d72a /indra/newview/tests
parentab9cb6fcd96c1c29650d844b5fd76e2ebbf5f2df (diff)
Store script's LuaListener in userdata in lua_State's Registry.
Instead of deriving LuaListener from LLInstanceTracker with an int key, generating a unique int key and storing that key in the Registry, use new lua_emplace<LuaState>() to store the LuaListener directly in a Lua userdata object in the Lua Registry. Because lua_emplace<T>() uses LL.atexit() to guarantee that ~LuaState will destroy the T object, we no longer need ~LuaState() to make a special call specifically to destroy the LuaListener, if any. So we no longer need LuaState::getListener() separate from obtainListener(). Since LuaListener is no longer an LLInstanceTracker subclass, make LuaState::obtainListener() return LuaListener& rather than LuaListener::ptr_t.
Diffstat (limited to 'indra/newview/tests')
-rw-r--r--indra/newview/tests/llluamanager_test.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/newview/tests/llluamanager_test.cpp b/indra/newview/tests/llluamanager_test.cpp
index cf1bf25b5c..2d525f7913 100644
--- a/indra/newview/tests/llluamanager_test.cpp
+++ b/indra/newview/tests/llluamanager_test.cpp
@@ -398,7 +398,7 @@ namespace tut
LuaState L;
auto future = LLLUAmanager::startScriptLine(L, lua);
- auto replyname{ L.obtainListener()->getReplyName() };
+ auto replyname{ L.obtainListener().getReplyName() };
auto& replypump{ LLEventPumps::instance().obtain(replyname) };
// LuaState::expr() periodically interrupts a running chunk to ensure
// the rest of our coroutines get cycles. Nonetheless, for this test