Apparently a user managed to remove a SC input and then
use the input's context-menu before the UI had caught up.
(PluginPinWidget::plugin_reconfigured happens during idle)
---
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 [..] PluginPinWidget::sc_input_press(_GdkEventButton*, boost::weak_ptr<ARDOUR::Port>) + 1140
AudioRegionView() c'tor calls create_waves() early on
before the _height is set [1].
Now one following can happen:
1. All peak-files are present. create_waves() directly calls
create_one_wave() for each channel. They are initialized
with zero height.
But all channels are present so waves[] is populated and
a later call to set_height() corrects this
2. All peak-files are still missing. create_waves() schedules
callbacks via PeaksReady -> peaks_ready_handler()
Those callbacks arrive after set_height() was called and
the waveforms are displayed correctly.
3. Only some peak-files are present. This can happen at
rec-stop when the region is created.
create_waves() directly calls create_one_wave() for available
peaks, and schedules peaks_ready_handler() for the remainder.
The directly created waves have zero-height.
Since not all waves are ready, they are stored in tmp_waves.
waves[] remains unpopulated.
The set_height() call only ever changed the height of wave[], which
resulted in hidden waveforms, until a user manually changed the
height of the track.
[1] the height is set from
```
#1 AudioStreamView::create_region_view(boost::shared_ptr<ARDOUR::Region>, bool, bool)
#2 AudioStreamView::add_region_view_internal(boost::shared_ptr<ARDOUR::Region>, bool, bool)
#3 StreamView::add_region_view(boost::weak_ptr<ARDOUR::Region>)
...
## PBD::Signal1 Playlist::RegionAdded()
```
We have to call close_view(), which calls IPlugView::removed()
before destroying the parent widget.
Previously ~VST3PluginUI() was called after the derived class
destroyed the owned private `_gui_widget`, `_ns_view` or x11 parent.
On windows that may lead to the hwnd of the window becoming invalid
before the call to ::removed().
VST3PluginInfo holds a shared_ptr reference to
VST3PluginModule. In order to cleanly unload a plugin, all
references have to be dropped.
Unloading a plugin cleanly before exit is needed in some
cases (e.g. Waves shell otherwise crashes)
Some fixed size AU, do unset `autoresizesSubviews` (Apple's default
is enabled). This also results in the initial size, and position
below Ardour's toolbar to be set incorrectly.
This fixes e.g. Reason Rack Plug AU (and maybe others).
This affects only windows opened from the mixer window,
in case the mixer is detached and on a different workspace (desktop).
Window::init (and Dialog::init) set transient parent early on,
and it defaults to the main window (with toolbar). It needs to be
unset before presenting the window, in order to show the window
on the same workspace as the eventual transient parent.
This follows 6dc9134 and f3fbf58.
This follows f3fbf58185 which unconditionally set the main window
as transient parent. However when detaching the mixer, plugins should
be transient for the detached parent window.