Skip to content
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

Fix a bug in the counter coroutine #118

Merged
merged 1 commit into from
Jul 30, 2022
Merged

Fix a bug in the counter coroutine #118

merged 1 commit into from
Jul 30, 2022

Conversation

SnootierMoon
Copy link
Contributor

@SnootierMoon SnootierMoon commented Jul 24, 2022

This pull request fixes #98 and fixes #112.
The issue is that when counter happens to get called for the last time by run_hook, the coroutine terminates and returns nil, rather than returning true which is expected from coroutine.yield(true). Therefore, run_hook ends up returning nil here which causes counter to be called again in clone here. This resumes a dead coroutine, hence the error.
This PR fixes this by returning true at the end of the coroutine, which seems to be the intended behavior.

@savq savq merged commit bc5950b into savq:master Jul 30, 2022
@savq
Copy link
Owner

savq commented Jul 30, 2022

Thanks!

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