mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-12 09:18:01 +00:00
Fix undefined behavior in the editor wasm bridge (#414)
* removed possible undifined behavior * changed naming of Editor -> JsEditorHandle * fix rust formatting Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
6701437433
commit
53a1f19af0
3 changed files with 32 additions and 15 deletions
|
@ -6,12 +6,16 @@ pub mod type_translators;
|
|||
use editor::message_prelude::FrontendMessage;
|
||||
use logging::WasmLog;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::panic;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
// Set up the persistent editor backend state
|
||||
static LOGGER: WasmLog = WasmLog;
|
||||
thread_local! { pub static EDITOR_HAS_CRASHED: RefCell<Option<FrontendMessage>> = RefCell::new(None); }
|
||||
thread_local! {
|
||||
pub static EDITOR_HAS_CRASHED: RefCell<Option<FrontendMessage>> = RefCell::new(None);
|
||||
pub static EDITOR_INSTANCES: RefCell<HashMap<u64, editor::Editor>> = RefCell::new(HashMap::new());
|
||||
}
|
||||
|
||||
// Initialize the backend
|
||||
#[wasm_bindgen(start)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue