pub fn run_register<P>(format: &str, body: impl FnOnce())Expand description
Run a register_* body under std::panic::catch_unwind.
Format wrappers’ register_* entry points run during plugin
registration - some from extern "C" fn init static
initializers (.init_array / __mod_init_func / .CRT$XCU),
others lazily on the first host query (AAX, to keep the Windows
loader-lock window empty during Pro Tools’ scan). A panic that
escapes them crosses an extern "C"
boundary and aborts the host process - a panic = "abort"
configuration would do the same. Catching the unwind here turns
any panic during registration into a logged diagnostic plus
“host sees no plugin,” which is the same outcome a plugin author
would expect from a missing bus_layouts declaration.
AssertUnwindSafe is applied internally - the panic is treated
as fatal-for-this-plugin, so leaving an Arc ref-count or
OnceLock half-set is acceptable: the host won’t load the
plugin and the process will exit shortly after registration
finishes anyway.