summaryrefslogtreecommitdiff
path: root/src/lua.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2023-06-04 02:31:29 +0100
committerAlex Orlenko <zxteam@protonmail.com>2023-06-04 02:31:29 +0100
commit8ab0ccf11cfbc4bd6e052fc1ff49e73ee4bd1f4c (patch)
treecb94d04b84e4a01f653d0c94e3f9f7c24df24fe8 /src/lua.rs
parent9596f2e9ee66d8f11c599d1465d92a6695c69bd3 (diff)
downloadmlua-8ab0ccf11cfbc4bd6e052fc1ff49e73ee4bd1f4c.zip
Don't keep poll function in environment globals when polling async functions.
This is redundant after deprecating scoped async. Closes #281
Diffstat (limited to 'src/lua.rs')
-rw-r--r--src/lua.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lua.rs b/src/lua.rs
index d8bb215..06bc5a3 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -2845,11 +2845,10 @@ impl Lua {
LightUserData(&ASYNC_POLL_PENDING as *const u8 as *mut c_void)
})?;
- // We set `poll` variable in the env table to be able to destroy upvalues
self.load(
r#"
- poll = get_poll(...)
- local poll, pending, yield, unpack = poll, pending, yield, unpack
+ local poll = get_poll(...)
+ local pending, yield, unpack = pending, yield, unpack
while true do
local ready, res, nres = poll()
if ready then