mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Move the sockets after the threads in Vst2Bridge
This way the sockets can be destroyed before the threads, and we can safely wait for the threads to shut down. I initially had Win32Thread imitate std::jthread's join-on-destruct, but that was causing group processes to hang. Now we can safely add that back again, and this will fix some spurious segfaults during plugin scans when using plugin groups containing a massive amount of plugins.
This commit is contained in:
@@ -186,11 +186,6 @@ class Vst2Bridge {
|
|||||||
*/
|
*/
|
||||||
AEffect* plugin;
|
AEffect* plugin;
|
||||||
|
|
||||||
/**
|
|
||||||
* All sockets used for communicating with this specific plugin.
|
|
||||||
*/
|
|
||||||
Sockets<Win32Thread> sockets;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The thread that specifically handles `effProcessEvents` opcodes so the
|
* The thread that specifically handles `effProcessEvents` opcodes so the
|
||||||
* plugin can still receive MIDI during GUI interaction to work around Win32
|
* plugin can still receive MIDI during GUI interaction to work around Win32
|
||||||
@@ -207,6 +202,15 @@ class Vst2Bridge {
|
|||||||
*/
|
*/
|
||||||
Win32Thread process_replacing_handler;
|
Win32Thread process_replacing_handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All sockets used for communicating with this specific plugin.
|
||||||
|
*
|
||||||
|
* NOTE: This is defined **after** the threads on purpose. This way the
|
||||||
|
* sockets will be closed first, and we can then safely wait for the
|
||||||
|
* threads to exit.
|
||||||
|
*/
|
||||||
|
Sockets<Win32Thread> sockets;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A scratch buffer for sending and receiving data during `process` and
|
* A scratch buffer for sending and receiving data during `process` and
|
||||||
* `processReplacing` calls.
|
* `processReplacing` calls.
|
||||||
|
|||||||
Reference in New Issue
Block a user