You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#266 (Windows Thread-based DPI awareness) causes Ableton to crash #274
#266 has resulted in the opening of a baseview window in Ableton to crash. The same plugin built with baseview prior to #266 is able to open with no issues.
The crash is caused by a panic: thread 'unnamed' panicked at 'RefCell already borrowed': C:\programming\external\baseview\src\win\window.rs:526, which corresponds to handle_event calling self.handler.borrow_mut.
It seems that Ableton triggers a number of events while opening the window:
I've discovered an interesting wrinkle here: This crash occurred prior to #266if "Auto scale plugin window" is de-selected for the plugin (it's enabled by default). When "Auto scale plugin window" (ASPW from now on) is selected, the windows that are created are universally not DPI aware and are opened with a pre-scaled window size.
This try_borrow_mut fix prevents a crash in either ASPW mode, of course, but when ASPW is de-selected the window does not get scaled correctly. The baseview application still receives a resize event with the correct size, however, so skipping the on_event doesn't seem to have a negative affect in this case.
Based on the ASPW-related link above, I suspect the incorrect window size is due to nice-plug not knowing how to resize VST3 windows. In other words, baseview is probably not at fault for this.
Edit: Confirmed that I can get a correctly-sized window with the right DPI by hacking nice-plug, though I probably could have just used a version of it that included https://codeberg.org/RustAudio/nice-plug/pulls/48
Ah, yeah I see what's going on. Indeed you can nudge the host into making a sequence of events that doesn't crash baseview, but it's still the one that's crashing due to reentrant events.
I think #267 should help with this (although it and all of the next branch are full of breaking changes, so it's hard to just switch to it for testing)
Activity
AlexCharlton commentedon Jun 19, 2026
I've discovered an interesting wrinkle here: This crash occurred prior to #266 if "Auto scale plugin window" is de-selected for the plugin (it's enabled by default). When "Auto scale plugin window" (ASPW from now on) is selected, the windows that are created are universally not DPI aware and are opened with a pre-scaled window size.
This
try_borrow_mutfix prevents a crash in either ASPW mode, of course, but when ASPW is de-selected the window does not get scaled correctly. The baseview application still receives a resize event with the correct size, however, so skipping theon_eventdoesn't seem to have a negative affect in this case.AlexCharlton commentedon Jun 19, 2026
Based on the ASPW-related link above, I suspect the incorrect window size is due to nice-plug not knowing how to resize VST3 windows. In other words, baseview is probably not at fault for this.
Edit: Confirmed that I can get a correctly-sized window with the right DPI by hacking nice-plug, though I probably could have just used a version of it that included https://codeberg.org/RustAudio/nice-plug/pulls/48
prokopyl commentedon Jun 21, 2026
Ah, yeah I see what's going on. Indeed you can nudge the host into making a sequence of events that doesn't crash baseview, but it's still the one that's crashing due to reentrant events.
I think #267 should help with this (although it and all of the
nextbranch are full of breaking changes, so it's hard to just switch to it for testing)prokopyl commentedon Jun 24, 2026
I have just updated
egui-baseviewto the latestnextbranch commit here: https://codeberg.org/RustAudio/egui-baseview/pulls/31If your plugin uses egui, perhaps you could patch it to try it using the latest baseview that way?
AlexCharlton commentedon Jun 28, 2026
I don't use egui, but I got my test plugin working with the next branch and I can confirm that this is no longer an issue on that branch!
prokopyl commentedon Jul 5, 2026
Closing this, as this is now fixed in
0.2.0which is now out!