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>
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>
Add left double click to add marker to 3D map.
Add support for alititudeReference for polygon and polyline.
Add support for plugins to set color of polygons.
Allow OpenSkyNetwork DB, OpenAIP and OurAirports DB stuctures to be
shared by different plugins, to speed up loading.
Perform map anti-aliasing on the whole map, rather than just info boxes,
to improve rendering speed when there are many items. Add map
multisampling as a preference.
Add plotting of airspaces, airports, navaids on Map feature.
Add support for polylines and polygons to be plotted on Map feature.
Add support for images to 2D Map feature.
Add distance and name filters to Map feature.
Filter map items when zoomed out or if off screen, to improve rendering
performance.
Add UK DAB, FM and AM transmitters to Map feature.
Use labelless maps for 2D transmit maps in Map feature (same as in ADS-B
demod).