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