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
// 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.

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
// 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<dyn GuiContext + 'context>,
) -> Option<Box<dyn Editor + 'context>> {
context: Arc<dyn GuiContext>,
) -> Option<Box<dyn Editor>> {
None
}