From c813481357e6ce4016e2c018c856f92eb0ad1044 Mon Sep 17 00:00:00 2001 From: locphamtran Date: Sat, 15 Aug 2026 21:49:00 +0700 Subject: [PATCH] G1.4: dong bo comment voi code - bo ghi chu mute-when-editor-open con sot (dispatch channelQuiet, attach job); ghi ro reloading_ chi mute khi createView/createInstance chay --- native_bridge/src/main.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/native_bridge/src/main.cpp b/native_bridge/src/main.cpp index a18d9cc..2cc605f 100644 --- a/native_bridge/src/main.cpp +++ b/native_bridge/src/main.cpp @@ -675,7 +675,7 @@ int main(int argc, char* argv[]) { // channelQuiet + instrument call) so assign()/unload() can never // destroy the instance mid-call — use-after-free when loading a new // VSTi while other channels keep playing. channelQuiet drops events - // for channels mid-reload or whose plugin DLL has an open editor. + // for channels mid-reload only (G1.4: bo mute-when-editor-open). // CRASH FIX: noteOn/noteOff/CC enter the plugin (DLL entry); a C++ // exception from the plugin must not escape the audio loop. try { @@ -895,15 +895,11 @@ int main(int argc, char* argv[]) { // loop) dispatch messages cua no - khong can pump worker. // Chan UAF bang flag reloading_ (set/clear duoi engine // mutex; renderAll giu mutex khi process). - // CRASH FIX (0xc000041d USER32 while playing): keep THIS - // channel silenced for the whole time its editor is attached. - // The worker pumps the plugin's editor windows -> the plugin's - // window proc runs on this worker thread while the audio loop - // calls processor->process() on the SAME instance (two threads - // inside one DLL) -> Nexus crashes ~1-2s after attach during - // playback. Muting the channel while the editor is open is the - // deterministic trade-off (track silent while GUI visible); - // restored when the editor closes (post_close_gui / LOAD). + // G1.4: bo mute-when-editor-open - channel process() binh + // thuong khi editor mo trong PLAY (verified: writeIndex + // advancing voi GUI open, Nexus khong crash). reloading_ giu + // im channel chi trong luc createView/createInstance chay + // (2 thread 1 DLL); clear ngay sau attach xong. // STALL/CRASH FIX (Fix C, restored): silence EVERY channel // assigned the SAME plugin DLL path for the reload+attach // duration — the audio loop must not process() another