diff --git a/src/plugin/bridges/vst3-impls/plug-view-proxy.cpp b/src/plugin/bridges/vst3-impls/plug-view-proxy.cpp index 8212ebdb..dbce87d6 100644 --- a/src/plugin/bridges/vst3-impls/plug-view-proxy.cpp +++ b/src/plugin/bridges/vst3-impls/plug-view-proxy.cpp @@ -211,12 +211,12 @@ Vst3PlugViewProxyImpl::setFrame(Steinberg::IPlugFrame* frame) { // owned by REAPER then REAPER will eventually segfault We should thus // try to call those functions from an `IRunLoop` event handler. try { - run_loop_tasks = Steinberg::owned(new RunLoopTasks(plug_frame)); + run_loop_tasks.emplace(plug_frame); } catch (const std::runtime_error& e) { // In case the host does not support `IRunLoop` or if we can't // register an event handler, we'll throw during `RunLoopTasks`' // constructor - run_loop_tasks = nullptr; + run_loop_tasks.reset(); bridge.logger.log( "The host does not support IRunLoop, falling back to naive GUI " diff --git a/src/plugin/bridges/vst3-impls/plug-view-proxy.h b/src/plugin/bridges/vst3-impls/plug-view-proxy.h index 87422bce..c6a26eee 100644 --- a/src/plugin/bridges/vst3-impls/plug-view-proxy.h +++ b/src/plugin/bridges/vst3-impls/plug-view-proxy.h @@ -278,9 +278,7 @@ class Vst3PlugViewProxyImpl : public Vst3PlugViewProxy { * the host's GUI thread using a run loop event handler in * `Vst3PlugViewProxyImpl::run_gui_task`. * - * _This value is optional_ and it will this be a null pointer of the host - * does not support `IRunLoop`. We have to use an `IPtr` instead of a an - * `std::optional` in case the host also stores a pointer to this. + * This will be an `std::nullopt` if the hostdoes not support `IRunLoop`. */ - Steinberg::IPtr run_loop_tasks; + std::optional run_loop_tasks; };