From d35957db657ab649f2e2319203579dafdf21a90a Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 6 Feb 2022 00:21:47 +0100 Subject: [PATCH] Require static lifetimes on GUI contexts --- src/context.rs | 2 +- src/plugin.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/context.rs b/src/context.rs index b4c351bb..c95e556e 100644 --- a/src/context.rs +++ b/src/context.rs @@ -65,7 +65,7 @@ pub trait ProcessContext { // // The implementing wrapper can assume that everything is being called from the main thread. Since // NIH-plug doesn't own the GUI event loop, this invariant cannot be part of the interface. -pub trait GuiContext: Send + Sync { +pub trait GuiContext: Send + Sync + 'static { /// Retrieve a safe setter for updating the plugin's parameters. Modifying parameters here will /// broadcast the changes both to the host and to your plugin's /// [crate::param::internals::Params] object. diff --git a/src/plugin.rs b/src/plugin.rs index 7d69403e..161ab47c 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -81,11 +81,11 @@ pub trait Plugin: Default + Send + Sync + 'static { // 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 create_editor<'a, 'context: 'a>( - &'a self, + fn create_editor( + &self, parent: EditorWindowHandle, - context: Arc, - ) -> Option> { + context: Arc, + ) -> Option> { None }