diff --git a/Cargo.lock b/Cargo.lock index a7811733d..5147f9f49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5052,7 +5052,7 @@ version = "0.1.0" [[package]] name = "reaper-fluent" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "fragile", "reaper-low", @@ -5063,7 +5063,7 @@ dependencies = [ [[package]] name = "reaper-high" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "backtrace", "base64 0.13.0", @@ -5093,7 +5093,7 @@ dependencies = [ [[package]] name = "reaper-low" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "c_str_macro", "cc 1.0.79", @@ -5107,7 +5107,7 @@ dependencies = [ [[package]] name = "reaper-macros" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "darling 0.10.2", "quote 1.0.30", @@ -5117,7 +5117,7 @@ dependencies = [ [[package]] name = "reaper-medium" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "c_str_macro", "derive_more", @@ -5135,7 +5135,7 @@ dependencies = [ [[package]] name = "reaper-rx" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "crossbeam-channel", "helgoboss-midi", @@ -5376,7 +5376,7 @@ dependencies = [ [[package]] name = "rppxml-parser" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#4617fe8e33ffba882c010d7a11edeac793ccbf25" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#1d6e7fa813dca8674b515a7f73d8478e86eb935c" dependencies = [ "splitty", ] diff --git a/Cargo.toml b/Cargo.toml index 57fb7c9d4..aa1ed5ac4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -154,6 +154,7 @@ vst = { git = "https://github.com/helgoboss/vst-rs.git", branch = "feature/param #reaper-fluent = { path = "../reaper-rs/main/fluent" } #reaper-high = { path = "../reaper-rs/main/high" } #reaper-medium = { path = "../reaper-rs/main/medium" } +#reaper-macros = { path = "../reaper-rs/main/macros" } #reaper-low = { path = "../reaper-rs/main/low" } #reaper-rx = { path = "../reaper-rs/main/rx" } #rppxml-parser = { path = "../reaper-rs/main/rppxml-parser" } diff --git a/main/src/infrastructure/plugin/app.rs b/main/src/infrastructure/plugin/app.rs index ef640e82f..044b5bdf8 100644 --- a/main/src/infrastructure/plugin/app.rs +++ b/main/src/infrastructure/plugin/app.rs @@ -1699,7 +1699,15 @@ impl Drop for App { fn drop(&mut self) { self.message_panel.close(); self.party_is_over_subject.next(()); - let _ = unregister_api(); + // This is ugly but we need it on Windows where getting the current thread can lead to + // "use of std::thread::current() is not possible after the thread's local data has been destroyed" + // when exiting REAPER. The following code essentially ignores this. + let old_panic_hook = std::panic::take_hook(); + std::panic::set_hook(Box::new(|_| {})); + let _ = std::panic::catch_unwind(|| { + let _ = unregister_api(); + }); + std::panic::set_hook(old_panic_hook); } } diff --git a/main/src/infrastructure/plugin/realearn_plugin.rs b/main/src/infrastructure/plugin/realearn_plugin.rs index aef164338..24cb55465 100644 --- a/main/src/infrastructure/plugin/realearn_plugin.rs +++ b/main/src/infrastructure/plugin/realearn_plugin.rs @@ -23,7 +23,7 @@ use base::{ use helgoboss_allocator::*; use lazycell::LazyCell; use reaper_high::{Reaper, ReaperGuard}; -use reaper_low::{reaper_vst_plugin, static_vst_plugin_context, PluginContext}; +use reaper_low::{static_vst_plugin_context, PluginContext}; use reaper_medium::{Hz, ReaperStr}; use slog::{debug, o}; @@ -56,9 +56,8 @@ const NORMAL_REAL_TIME_TO_MAIN_TASK_QUEUE_SIZE: usize = 10_000; const CONTROL_MAIN_TASK_QUEUE_SIZE: usize = 5000; const PARAMETER_MAIN_TASK_QUEUE_SIZE: usize = 5000; -reaper_vst_plugin!(); - -/// A REAPER-extension-like entry point, *in addition* to the VST entry point. +/// Generates a REAPER-extension-like entry point. It also generates everything that +/// `reaper_vst_plugin!` macro would generate, so we don't need that anymore. /// /// This needs some explanation: No, we are not a REAPER extension! This extension entry point will /// not be called by REAPER (because our shared library is located in the "UserPlugins/FX"