File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2391,6 +2391,9 @@ impl dispatch::DeviceInterface for WebDevice {
23912391 ) ;
23922392 } ) ;
23932393 let _ = self . inner . lost ( ) . then ( & closure) ;
2394+ // Release memory management of this closure from Rust to the JS GC.
2395+ // TODO: This will leak if weak references is not supported.
2396+ closure. forget ( ) ;
23942397 }
23952398
23962399 fn on_uncaptured_error ( & self , handler : Box < dyn crate :: UncapturedErrorHandler > ) {
@@ -2400,7 +2403,8 @@ impl dispatch::DeviceInterface for WebDevice {
24002403 } ) as Box < dyn FnMut ( _) > ) ;
24012404 self . inner
24022405 . set_onuncapturederror ( Some ( f. as_ref ( ) . unchecked_ref ( ) ) ) ;
2403- // TODO: This will leak the memory associated with the error handler by default.
2406+ // Release memory management of this closure from Rust to the JS GC.
2407+ // TODO: This will leak if weak references is not supported.
24042408 f. forget ( ) ;
24052409 }
24062410
You can’t perform that action at this time.
0 commit comments