MCPcopy Create free account
hub / github.com/GraphiteEditor/Graphite / drop

Method drop

node-graph/libraries/canvas-utils/src/wasm.rs:196–208  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

194
195impl Drop for CanvasImpl {
196 fn drop(&mut self) {
197 let canvas_id = self.canvas_id;
198 let window = window().expect("should have a window in this context");
199 let window_obj = Object::from(window);
200
201 let image_canvases_key = JsValue::from_str(CANVASES_OBJECT_KEY);
202
203 if let Ok(canvases) = Reflect::get(&window_obj, &image_canvases_key) {
204 let canvases = Object::from(canvases);
205 let js_key = JsValue::from_str(canvas_id.to_string().as_str());
206 Reflect::delete_property(&canvases, &js_key).unwrap();
207 }
208 }
209}
210
211// SAFETY: WASM is single-threaded, so Send/Sync are safe

Callers

nothing calls this directly

Calls 2

getFunction · 0.50
as_strMethod · 0.45

Tested by

no test coverage detected