Fix event handlers not being unregistered

This would cause crashes in Bitwig, as `RunLoopTasks`' destructor would
not be run after the event handler has been unregistered, and we
unregister the event handler in that destructor.
This commit is contained in:
Robbert van der Helm
2021-01-20 00:19:15 +01:00
parent c08d704dc0
commit 508d393bbc
2 changed files with 4 additions and 6 deletions
@@ -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<RunLoopTasks> run_loop_tasks;
std::optional<RunLoopTasks> run_loop_tasks;
};