From ed3b319f4f3e65c6b4ac71d6ea694c2728676fba Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 19 Apr 2020 17:00:17 +0200 Subject: [PATCH] Clean up socket endpoint files --- src/plugin/host-bridge.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugin/host-bridge.cpp b/src/plugin/host-bridge.cpp index 4ea6f798..b0f92876 100644 --- a/src/plugin/host-bridge.cpp +++ b/src/plugin/host-bridge.cpp @@ -134,6 +134,11 @@ HostBridge::HostBridge(audioMasterCallback host_callback) socket_acceptor.accept(host_vst_process_replacing); socket_acceptor.accept(vst_host_aeffect); + // There's no need to keep the socket endpoint file around after accepting + // all the sockets, and RAII won't clean these files up for us + socket_acceptor.close(); + fs::remove(socket_endpoint.path()); + // Set up all pointers for our `AEffect` struct. We will fill this with data // from the VST plugin loaded in Wine at the end of this constructor. plugin.ptr3 = this; @@ -275,10 +280,6 @@ intptr_t HostBridge::dispatch(AEffect* /*plugin*/, switch (opcode) { case effClose: { - // TODO: Gracefully close the editor? - // TODO: Check whether the sockets and the endpoint are closed - // correctly - // Allow the plugin to handle its own shutdown. I've found a few // plugins that work fine except for that they crash during // shutdown. This shouldn't have any negative side effects since