mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 21:31:29 +11:00
Remove Canvas
when dropped
This commit is contained in:
parent
b79089ea57
commit
9c5657b86c
|
@ -17,6 +17,12 @@ pub struct Canvas {
|
|||
on_mouse_scroll: Option<Closure<dyn FnMut(WheelEvent)>>,
|
||||
}
|
||||
|
||||
impl Drop for Canvas {
|
||||
fn drop(&mut self) {
|
||||
self.raw.remove();
|
||||
}
|
||||
}
|
||||
|
||||
impl Canvas {
|
||||
pub fn create() -> Result<Self, RootOE> {
|
||||
let window = web_sys::window().expect("Failed to obtain window");
|
||||
|
|
Loading…
Reference in a new issue