1
0
Fork 0

Require static lifetimes on GUI contexts

This commit is contained in:
Robbert van der Helm 2022-02-06 00:21:47 +01:00
parent 3c867f9305
commit d35957db65
2 changed files with 5 additions and 5 deletions

View file

@ -65,7 +65,7 @@ pub trait ProcessContext {
// //
// The implementing wrapper can assume that everything is being called from the main thread. Since // 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. // 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 /// 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 /// broadcast the changes both to the host and to your plugin's
/// [crate::param::internals::Params] object. /// [crate::param::internals::Params] object.

View file

@ -81,11 +81,11 @@ pub trait Plugin: Default + Send + Sync + 'static {
// otherwise be basically impossible to have this still be GUI-framework agnostic. Any // 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 // callback that deos involve actual GUI operations will still be spooled to the IRunLoop
// instance. // instance.
fn create_editor<'a, 'context: 'a>( fn create_editor(
&'a self, &self,
parent: EditorWindowHandle, parent: EditorWindowHandle,
context: Arc<dyn GuiContext + 'context>, context: Arc<dyn GuiContext>,
) -> Option<Box<dyn Editor + 'context>> { ) -> Option<Box<dyn Editor>> {
None None
} }