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

Edge case "cannot spawn non-suspended coroutine with arguments" #12

Open
OttoHatt opened this issue Jul 5, 2024 · 0 comments
Open

Edge case "cannot spawn non-suspended coroutine with arguments" #12

OttoHatt opened this issue Jul 5, 2024 · 0 comments

Comments

@OttoHatt
Copy link

OttoHatt commented Jul 5, 2024

The following errors cannot spawn non-suspended coroutine with arguments:

local signal = Signal.new()
local run = task.spawn(function()
    signal:Wait()
end)
task.cancel(run)
signal:Fire("some", "arguments")

The signal tries to resume an already dead coroutine, throwing an error. Because this is called within another couroutine, execution continues past the :Fire() call and the intended behavior is still achieved.

Further reading. I think a check to ensure the coroutine isn't dead before trying to resume will match native signal behaviour?

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

No branches or pull requests

1 participant