1
0
Fork 0

Require Send+Sync on the editor handle

This commit is contained in:
Robbert van der Helm 2022-03-03 15:39:17 +01:00
parent 91f2f49fd3
commit d688174b8b
2 changed files with 6 additions and 2 deletions

View file

@ -88,7 +88,7 @@ where
&self,
parent: ParentWindowHandle,
context: Arc<dyn nih_plug::GuiContext>,
) -> Box<dyn std::any::Any> {
) -> Box<dyn std::any::Any + Send + Sync> {
let update = self.update.clone();
let state = self.user_state.clone();

View file

@ -204,7 +204,11 @@ pub trait Editor: Send + Sync {
// otherwise be basically impossible to have this still be GUI-framework agnostic. Any
// callback that deos involve actual GUI operations will still be spooled to the IRunLoop
// instance.
fn spawn(&self, parent: ParentWindowHandle, context: Arc<dyn GuiContext>) -> Box<dyn Any>;
fn spawn(
&self,
parent: ParentWindowHandle,
context: Arc<dyn GuiContext>,
) -> Box<dyn Any + Send + Sync>;
/// Return the (currnent) size of the editor in pixels as a `(width, height)` pair.
fn size(&self) -> (u32, u32);