G2.4: skip redundant LOAD of already-loaded instrument (keep restored preset)
This commit is contained in:
@@ -1129,6 +1129,16 @@ int main(int argc, char* argv[]) {
|
||||
std::string path(c.arg2, plen);
|
||||
InstrumentType t = (InstrumentType)c.arg0;
|
||||
uint32_t ch = c.channel & 0xF;
|
||||
uiWorker.post([&instruments, t, ch, path, sampleRate, block]() {
|
||||
// G2.4: double-load guard - sau respawn/bootstrap, JS
|
||||
// reconnect reload gui LOAD cung path (C++ da tu restore
|
||||
// tu state file); thay instance se mat preset. Skip khi
|
||||
// channel da co DUNG instrument nay.
|
||||
if (!path.empty() && !lower_plugin_path(ch).empty() &&
|
||||
lower_plugin_path(ch) == lower_path_str(path)) {
|
||||
std::cout << "[NativeBridge] LOAD skip ch=" << ch
|
||||
<< " (already loaded: " << path << ")" << std::endl;
|
||||
return;
|
||||
}
|
||||
// CRASH FIX: this job enters the plugin DLL (createInstance
|
||||
// in loadPlugin, old-instance terminate on replace) while
|
||||
|
||||
Reference in New Issue
Block a user