DioxusLabs / dioxus

App framework for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
20.43k stars 786 forks source link

Event handlers are dropped twice #2286

Closed matthunz closed 5 months ago

matthunz commented 5 months ago

Problem

In certain situations event handlers can be dropped twice and panic

Looks to come from

 #[doc(hidden)]
/// This should only be used by the `rsx!` macro.
pub fn __take(&self) -> ExternalListenerCallback<T> {
    self.callback
        .manually_drop()
        .expect("Signal has already been dropped")
        .expect("EventHandler was manually dropped")
}

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

Make sure event handlers don't drop twice.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment:

Questionnaire