GET /sdrangel/windows lists every device, spectrum, channel and feature
window with its workspace, title and whether it is hidden; the workspace
PUTs take a hidden field alongside the index.
The Web API has no access to the GUI, so MainCore keeps a table of what
the GUI has published for each window, keyed by the DeviceAPI,
SpectrumVis, ChannelAPI or Feature it belongs to. The GUI side is a new
WorkspaceWindow base for the four window classes, which publishes on
every show and hide, on a retitle and when the workspaces are renumbered,
and takes the workspace from the window's Workspace ancestor rather than
the plugin's settings, which a settings message from the channel can
reset.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SpectrumVis retains a raw pointer to GLSpectrum while GLSpectrum is owned
and destroyed by the Qt object hierarchy under DeviceUISet. DeviceUISet
could therefore destroy GLSpectrum while the DSP thread still had access
to the stale pointer through SpectrumVis. :(
AddressSanitizer reported a use-after-free in:
GLSpectrumView::updateSpectrumNoBuffer
SpectrumVis::processFFT
SpectrumVis::feed
DSPDeviceSourceEngine::work
with the GLSpectrumView destruction occurring from:
GLSpectrumView::~GLSpectrumView()
QObjectPrivate::deleteChildren()
Clear the SpectrumVis GLSpectrum reference before destroying the Qt-owned
GUI objects. This is safe with the DSP engine running because the
SpectrumVis interface already treats the GLSpectrum reference as optional:
processFFT() checks m_glSpectrum before using it. The GUI can therefore
detach the spectrum visualization while DSP processing continues, after
which the DSP path simply stops forwarding spectrum data to the deleted
GUI object.
Do not explicitly delete GLSpectrum here because its Qt parent owns it.
Found by AddressSanitizer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>