ACARS: Add Web API support. Add additional reporting to Aircraft feature. Add Iridium support.
Aircraft feature: Add Web API support. Add additional fields and data. Add coverage map. Support feeding. Archive messages.
SELCAL: Report calls to Aircraft feature.
Map: Update Cesium. Add flyby mode. Add ND, EFIS, RMP, DCDU. Add Boeing styling. Fix z-ordering on 2D map. Support sounds on 3D map. Save/restore splitter state. Hide quota using Cesium options when API not set. Link aircraft with Aircraft feature.
Normalize existing text files to LF to conform to the repository-wide
line-ending policy defined by .gitattributes by:
git add --renormalize .
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MessageQueue::pop() transfers ownership of the popped message to the
caller, but many handleInputMessages() implementations only deleted
the message when handleMessage() returned true. When a message was not
handled, ownership had already been transferred from the queue and the
message was leaked.
This was identified while investigating an ASAN leak in the audio
subsystem.
Update the applicable handleInputMessages() implementations to always
delete messages after handleMessage() returns. Unhandled messages are
also logged with the component and message identifier so unexpected
message routing is visible during debugging.
This change:
- Ensures every message popped from a queue has its ownership resolved.
- Prevents leaks when handleMessage() returns false.
- Makes unhandled messages visible instead of silently discarding them.
- Preserves the existing message handling logic and does not require
components to handle message types that are legitimately irrelevant
to them.
The changes are intentionally mechanical and limited to the common
message queue ownership and diagnostic pattern.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Both overrode showEvent for the QTBUG-100333 redraw workaround without
calling the base class, so the window state FeatureGUI publishes on show
never ran and the windows API reported the windows hidden while they
were on screen.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Initialize the map settings change flags to false and the file index to zero so
the dialog starts with defined state before any settings or downloads are
processed.
These members were previously left uninitialized, allowing change tracking
and file index operations to use indeterminate values.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize m_latitude and m_longitude to zero so a MapItem has defined
coordinates before its position is updated.
The members were previously left uninitialized, allowing coordinate access to
use indeterminate values.
This resolves the uninitialized member findings reported by Coverity
(UNINIT_CTOR).
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Previously, geoReply() combined the sender null check with the reply error
check, allowing a null pQGeoCode to reach the error handling and subsequent
cleanup, which deferenced the pointer it was checking.
Check for a null sender first and return immediately when dynamic_cast()
fails. Valid replies then proceed through the existing error handling and
cleanup safely.
pointed out by cppcheck's nullPointerRedundantCheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Previously, geoReply() combined the sender null check with the reply error
check, allowing a null pQGeoCode to reach the error handling and subsequent
deleteLater() call.
Check for a null sender first and return immediately when dynamic_cast()
fails. Valid replies then proceed through the existing error handling and
cleanup safely.
pointed out by cppcheck's nullPointerRedundantCheck.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized m_rgbColor member to black to eliminate
the cppcheck UNINIT_CTOR warning. This ensures the map color starts in a defined
state and avoids undefined behavior from reading an uninitialized value.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize previously uninitialized ObjectMapModel display and longitude members to
defined values to eliminate cppcheck UNINIT_CTOR warnings. This ensures display
options and map view state start in a known state and avoids undefined behavior
from reading uninitialized members.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
Initialize the previously uninitialized aircraft state and roll members to
defined values to eliminate cppcheck UNINIT_CTOR warnings. This ensures the
stored aircraft state starts in a known state and avoids undefined behavior
from reading uninitialized values.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MapSettings owns the MapItemSettings objects stored in m_itemSettings, but
the destructor previously did not release them. Enabling the cleanup also
exposed that MapSettings was implicitly shallow-copying these raw pointers,
allowing multiple MapSettings instances to reference the same
MapItemSettings objects.
Add explicit copy construction and assignment so each MapSettings instance
gets its own MapItemSettings objects. Serialize and deserialize the settings
to perform the deep copy while preserving the existing rollup state.
When deserializing item settings into an existing MapSettings instance,
update existing MapItemSettings objects in place instead of replacing their
pointers. MapItem objects retain pointers to these settings, so preserving
pointer identity prevents those references from becoming dangling.
Release all MapItemSettings objects when MapSettings is destroyed.
This fixes the AddressSanitizer leak from MapSettings while avoiding the
use-after-free that occurs when the owned settings are deleted while other
MapSettings copies still reference the same objects.
Found by AddressSanitizer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MapModel owns the MapItem objects stored in m_items, but several
destruction paths previously removed objects from the model without
releasing them. ObjectMapItem also owns the track coordinates and
timestamps accumulated by updateTrack().
AddressSanitizer reported:
Direct leak of 29006400 byte(s) in 72516 object(s) allocated from:
#0 <addr> in operator new(unsigned long)
../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
#1 <addr> in ObjectMapModel::newMapItem(QObject const*, QString const&, MapSettings::MapItemSettings*, SWGSDRangel::SWGMapItem*)
./plugins/feature/map/mapmodel.cpp:427
The map update path removes an item permanently when its image becomes
empty. MapModel::remove() only removes the object from the model and hash,
so the object must be deleted after it has been removed and the 3D map has
been updated.
Also release all remaining MapItem objects when clearing or destroying
the model. MapItem has a virtual destructor so derived ObjectMapItem
instances are destroyed correctly through the MapItem pointer.
ObjectMapItem owns the QGeoCoordinate and QDateTime objects stored in its
track lists, so release those objects when the ObjectMapItem is destroyed.
The interpolated coordinate list is not deleted separately because it
references entries from m_takenTrackCoords.
Found by AddressSanitizer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
MapGUI owns the Aurora instance and the IonosondeStation objects stored in
m_ionosondeStations, but neither was released when MapGUI was destroyed.
AddressSanitizer reported:
Direct leak of 3232 byte(s) in 101 object(s)
#1 MapGUI::giroDataUpdated(...) mapgui.cpp:852
It also reported an indirect leak originating from the QNetworkAccessManager
created by Aurora:
Indirect leak of 376 byte(s) in 1 object(s)
#1 QNetworkAccessManager::QNetworkAccessManager(...)
#2 Aurora::create(...) aurora.cpp:314
Delete the Aurora instance and all stored IonosondeStation objects when
destroying MapGUI so their owned resources are released with the GUI.
Found by AddressSanitizer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
WebServer owns the substitution lists and the Substitution objects stored
in those lists. The destructor previously deleted only the heap-allocated
QList objects, leaving each Substitution allocated by addSubstitution()
leaked.
AddressSanitizer reported:
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 <addr> in operator new(unsigned long)
../../../../src/libsanitizer/asan/asan_new_delete.cpp:95
#1 <addr> in WebServer::addSubstitution(QString, QString, QString)
./plugins/feature/map/webserver.cpp:70
Fix deletes the Substitution objects before deleting their containing lists
so the complete substitution hierarchy is released when WebServer is
destroyed.
Found by AddressSanitizer.
Signed-off-by: Robin Getz <rgetz503@gmail.com>
A number of settings keys existed in the spec and in the SWG classes but
were missing from the plugin's webapi handlers, so setting them over the
API silently did nothing: dnrScheme on the SSB demodulator, aprsData on
the M17 modulator, pulseShaping on the packet, PSK31 and RTTY modulators,
audioDeviceName on Simple PTT, period, autosave, autoload, autosavePeriod
and filename on SID, and several on Star Tracker, XTRX and the Android SDR
driver input.
Three more were spelled so that they could never match. The channel
analyzer tested for "rationalDownSample " with a trailing space, radio
astronomy tested for "sweep12Start" and "sweep12Stop" rather than
"sweep2Start" and "sweep2Stop", and AFC read "hasTargetFrequency" into
m_transverterTarget rather than "transverterTarget". The channel analyzer
also now accepts the shorter "frequency", "downSample" and
"downSamplerRate" spellings alongside the existing ones.
MapSettings::applySettings ignored rgbColor and mapType, so a patch
carrying them was accepted and then dropped.
Registers MCPServer.yaml in the web API resources so it is served with the
rest of the documentation, and drops a redundant nested guard in the Sky
Map report left by the QString leak fix.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Every feature GUI ran its own one second QTimer, read getState(), compared
it against a remembered m_lastFeatureState and restyled its start/stop
button when the two differed. The same twenty five lines appeared in each
of them.
Feature now keeps m_state private behind setState(), which emits
stateChanged() when it actually changes, and FeatureGUI grows a shared
updateStartStopButton() that restyles the button and reports an error
state. A GUI connects to the signal and calls that, so the state is
reflected as soon as it changes rather than up to a second later, and the
per feature timers and m_lastFeatureState members are gone.
FeatureUISet disconnects the feature from its GUI before the feature is
deleted: QObject emits destroyed() before dropping its connections, so a
stateChanged() emitted from the feature's destructor could otherwise reach
a GUI that has already deleted its ui object.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Server side for the spectrum paths added to the spec: GET spectrum/report
returns whichever measurement is switched on, POST spectrum/actions
carries autoscale, clearSpectrum, resetMeasurements, freeze and
gotoMarker, and GET spectrum/data returns the power values reduced to a
number of bins. The display actions reach the spectrum through new
GLSpectrumInterface methods that default to doing nothing, so an instance
without a GUI ignores them rather than every caller having to know.
The measurement results are kept as plain values behind a lock and
published once per displayed frame, so a report costs nothing until one is
asked for, and the figures match what is on screen.
Also completes the main spectrum settings, which were only partly carried
over the API, and adds reports that had no way to be read at all: vessels
for AIS, stations for APRS, sondes for Radiosonde, the programme list for
DAB, the RDS programme service name for BFM, and validity flags for the
ADS-B aircraft report so a caller can tell a missing position from one at
zero. Map settings are exposed through their generated setters.
Two fixes found while testing: the frequency scanner dropped the frequency
list because the API calls it "frequencies" and everything downstream
keys it as "frequencySettings", and the spectrum adapters bound a
reference to the error message before init() had allocated one, so every
error path returned no response at all.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
QMessageBox::information() and friends build the box on the stack, parent
it to the calling widget and run a nested event loop in exec(). If the
parent is closed while the box is open, which the Web API can do at any
time, the parent deletes the box and its children and the heap is
corrupted.
MessageDialog offers the same calls, but the box is heap allocated, given
Qt::WA_DeleteOnClose and shown rather than exec'd, so nothing runs a
nested event loop and the box owns its own lifetime. A box with the same
text as one already up is raised instead of a second being created.
The trade off is that information(), warning() and critical() return
immediately and cannot report which button was pressed. question() takes
a callback for the cases that need the answer.
Converts the call sites in the device, channel and feature GUIs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The generated SWG setters overwrite the string pointer without deleting
what is already there, and every webapiSettingsGet and webapiReportGet
calls init() first, which has allocated one. Each call therefore leaked a
QString per string field. Measured at 117 bytes per settings GET for the
Satellite Tracker, over 20,000 requests.
Assign in place when the pointer is already set, which is what these same
functions have always done for title and reverseAPIAddress. 394 sites
across webapiFormatChannelSettings, webapiFormatDeviceSettings,
webapiFormatFeatureSettings and the three report equivalents.
The webapiReverseSend* functions are deliberately left alone: they build a
fresh SWG object whose constructor leaves the pointers null, so passing a
new QString is correct there.
After the change the same measurement is flat, at 7 bytes per GET.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add a destructor to ObjectMapItem to release its owned m_aircraftState.
ObjectMapItem allocates m_aircraftState when aircraft state is present,
but had no corresponding cleanup when the map item was destroyed.
Coverity reported the allocation as a constructor/destructor resource
leak.
Signed-off-by: Robin Getz <rgetz503@gmail.com>