summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/leap.lua
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-04-09 15:21:05 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-04-09 15:21:05 -0400
commit26ce33d8ead68c2dbcc37b2b1e040c072866fe5b (patch)
tree42ff25f1d1db25be3dfc740016ff75d12c847eb1 /indra/newview/scripts/lua/leap.lua
parent3114f674aaef019804803bed50972833f5411f93 (diff)
Add Lua Floater class to simplify Lua script showing floaters.
Add test_luafloater_demo2.lua and test_luafloater_gesture_list2.lua examples.
Diffstat (limited to 'indra/newview/scripts/lua/leap.lua')
-rw-r--r--indra/newview/scripts/lua/leap.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/scripts/lua/leap.lua b/indra/newview/scripts/lua/leap.lua
index d19273e8bc..ade91789f0 100644
--- a/indra/newview/scripts/lua/leap.lua
+++ b/indra/newview/scripts/lua/leap.lua
@@ -183,14 +183,15 @@ function leap.generate(pump, data, checklast)
-- bearing that reqid. Stamp the outbound request with that reqid, and
-- send it.
local reqid, waitfor = requestSetup(pump, data)
- local ok, response
+ local ok, response, resumed_with
repeat
ok, response = pcall(waitfor.wait, waitfor)
if not ok then
break
end
- coroutine.yield(response)
- until checklast and checklast(response)
+ -- can resume(false) to terminate generate() and clean up
+ resumed_with = coroutine.yield(response)
+ until (checklast and checklast(response)) or (resumed_with == false)
-- If we break the above loop, whether or not due to error, clean up.
pending[reqid] = nil
if not ok then