fix(bridge): one editor at a time + guard reload race

- Close other channels' editor windows before attaching a new one (Option B)
- needsReload()/setReloading() guard: skip processAudioBlock during
  terminate+reload teardown to avoid UAF/hang when reopening GUI
- Wait for editor registry cleanup (5s timeout) before creating window
This commit is contained in:
2026-08-13 15:32:35 +07:00
parent c3eb0c9d16
commit 05e4244cc8
7 changed files with 349 additions and 4 deletions
+3
View File
@@ -26,6 +26,8 @@ public:
void pitchBend(uint32_t channel, uint32_t bend14) override;
bool openGUI(void* parentWindowHandle) override;
void closeGUI() override;
bool needsReload() const override { return hasAttachedOnce_ && !guiAttached_; }
void setReloading(bool on) override { reloading_ = on; }
void processAudioBlock(float* outputL, float* outputR, uint32_t numSamples) override;
private:
@@ -37,6 +39,7 @@ private:
bool loaded_;
bool guiAttached_;
bool hasAttachedOnce_;
bool reloading_; // guarded by InstrumentEngineManager::mu_ (set via setReloading)
bool reload();
};