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

Spontaneously call of already dropped closure when using Listen::use_field<F> #17

Open
photovoltex opened this issue Mar 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@photovoltex
Copy link
Owner

photovoltex commented Mar 3, 2024

Sometimes a closure is accessed after being dropped. The provided test-project does produce the bug now and then.

From my current perspective it looks like a bug that is not often encountered in the wild. Will have to test it in an actual project to more accurately evaluate the severity of the bug.

For now it looks like a race condition where either the closure is hold to long in memory and hides the problem, or the listen event sometimes isn't detached fast enough and tries to call the dropped closure.

@photovoltex photovoltex added the bug Something isn't working label Mar 3, 2024
@photovoltex
Copy link
Owner Author

Output with new leptos version:

[Warning] [Signal::update] At Location { file: "/home/photovoltex/repo/tauri-interop/src/event/listen.rs", line: 118, col: 45 }, you’re trying to update a Signal<alloc::string::String> (defined at /home/photovoltex/repo/tauri-interop/src/event/listen.rs:111:36) that has already been disposed of. This is probably a logic error in a component that creates and disposes of scopes. If it does not cause any issues, it is safe to ignore this warning, which occurs only in debug mode. (frontend-70ef696a103500f1.js, line 652)

So this does confirm that it might be a racing condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant