From 8504dae1120c629fbee98ff401af89692dc7ae07 Mon Sep 17 00:00:00 2001 From: spotlessbuilder Date: Fri, 13 Dec 2024 17:37:58 -0700 Subject: [PATCH] Stop leaking the Box when unbinding event listeners --- native-windows-gui/src/win32/window.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-windows-gui/src/win32/window.rs b/native-windows-gui/src/win32/window.rs index 115176bf..7e344784 100644 --- a/native-windows-gui/src/win32/window.rs +++ b/native-windows-gui/src/win32/window.rs @@ -213,7 +213,7 @@ pub fn unbind_event_handler(handler: &EventHandler) } callback_ptr = callback_value as *mut *const Callback; - let callback: Rc = Rc::from_raw(*callback_ptr); + let callback: Rc = Rc::from_raw(*Box::from_raw(callback_ptr)); // Remove the window subclass before dropping the callback to prevent the // subclass window procedure from being called during the drop.