Skip to content

How to maintain the sandbox when dispatching events from C? #1578

Closed Answered by Derpius
Derpius asked this question in Q&A
Discussion options

You must be logged in to vote

Solved this myself (obvious once you think about it...)

When the chunk is loaded, any functions to be passed to event registration functions have already had their global env bound, and that doesn't change when called from another thread (i.e. the main thread). Verified (I think) by printing the global env from inside one of those event listeners

On the second question above, I've assumed yes as it was convenient to have a per-file global env anyway

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Derpius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant