{"record":{"id":"f4451710c2f7543c","repo":"DioxusLabs/dioxus","slug":"callback-was-manually-dropped","errorCode":null,"errorMessage":"Callback was manually dropped","messagePattern":"Callback was manually dropped","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/events.rs","lineNumber":532,"sourceCode":"            Location::caller(),\n        );\n        Self { callback, origin }\n    }\n\n    /// Call this callback with the appropriate argument type\n    ///\n    /// This borrows the callback using a RefCell. Recursively calling a callback will cause a panic.\n    #[track_caller]\n    pub fn call(&self, arguments: Args) -> Ret {\n        if let Some(callback) = self.callback.write().as_mut() {\n            let runtime = callback\n                .runtime\n                .upgrade()\n                .expect(\"Callback was called after the runtime was dropped\");\n            let _guard = RuntimeGuard::new(runtime.clone());\n            runtime.with_scope_on_stack(self.origin, || (callback.callback)(arguments))\n        } else {\n            panic!(\"Callback was manually dropped\")\n        }\n    }\n\n    /// Create a `impl FnMut + Copy` closure from the Closure type\n    pub fn into_closure(self) -> impl FnMut(Args) -> Ret + Copy + 'static {\n        move |args| self.call(args)\n    }\n\n    /// Forcibly drop the internal handler callback, releasing memory\n    ///\n    /// This will force any future calls to \"call\" to not doing anything\n    pub fn release(&self) {\n        self.callback.set(None);\n    }\n\n    /// Replace the function in the callback with a new one\n    pub fn replace(&mut self, callback: Box<dyn FnMut(Args) -> Ret>) {\n        let runtime = Runtime::current();","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/core/src/events.rs#L514-L550","documentation":"Callback::call tried to call a callback whose inner closure slot was empty because the Callback was manually dropped (e.g. by Callback::drop or replacing it). The RefCell write returned None, indicating the callback no longer exists at call time.","triggerScenarios":"Thrown at packages/core/src/events.rs:532 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The Callback was dropped before the event fired. Keep the callback alive (clone it) for as long as the event may be dispatched."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}