From 63267ddf563f660db5dfe33836d98a2ec3237bcd Mon Sep 17 00:00:00 2001 From: Jack Mac Date: Sun, 26 Sep 2021 22:27:19 -0400 Subject: [PATCH] better support for non-send-sync --- imgui/src/context.rs | 4 ++-- imgui/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui/src/context.rs b/imgui/src/context.rs index f4f6392..29b7bc5 100644 --- a/imgui/src/context.rs +++ b/imgui/src/context.rs @@ -243,7 +243,7 @@ impl Context { platform_name: None, renderer_name: None, clipboard_ctx: Box::new(ClipboardContext::dummy().into()), - ui: Ui(()), + ui: Ui(().into()), } } fn is_current_context(&self) -> bool { @@ -329,7 +329,7 @@ impl SuspendedContext { platform_name: None, renderer_name: None, clipboard_ctx: Box::new(ClipboardContext::dummy().into()), - ui: Ui(()), + ui: Ui(().into()), }; if ctx.is_current_context() { // Oops, the context was activated -> deactivate diff --git a/imgui/src/lib.rs b/imgui/src/lib.rs index 4c2d040..f6338cf 100644 --- a/imgui/src/lib.rs +++ b/imgui/src/lib.rs @@ -118,7 +118,7 @@ impl Context { /// A temporary reference for building the user interface for one frame #[derive(Debug)] -pub struct Ui(pub(crate) ()); +pub struct Ui(pub(crate) cell::UnsafeCell<()>); /// This is our internal buffer that we use for the Ui object. ///