Skip to content

fix(LuaEngine/Reload): Await callbacks before reloading, to not crash on callback #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mostlynick3
Copy link

Eluna reloads close the Lua engine, then opens it again. Callbacks from queries run before it is closed have no reference after this, and lead to a crash once received. This schedules reloads until after all pending callbacks have been processed.

@mostlynick3 mostlynick3 changed the title fix(LuaEngine/Reload) - Await callbacks before reloading, to not crash on callback fix(LuaEngine/Reload): Await callbacks before reloading, to not crash on callback Mar 23, 2025
@Foereaper
Copy link

Instead of keeping track of expected callbacks you could just check whether or not the async callback processor is empty or not, pretty much exactly like we do here

https://github.com/ElunaLuaEngine/Eluna/blob/a1d26bdd09f9a02c4fdc00977dd69be095160068/LuaEngine.cpp#L991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants