1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Free the QVector/QList memory where memory should be released

This commit is contained in:
Martin Tůma 2024-09-28 19:49:42 +02:00
parent 5d86852299
commit 7b516ca5e4
6 changed files with 13 additions and 13 deletions

View File

@ -22,7 +22,7 @@ static qint16 limit(const DEMTile *tile, quint16 factor)
void DEMFile::clear() void DEMFile::clear()
{ {
_levels.clear(); _levels = QVector<Level>();
} }
bool DEMFile::load(Handle &hdl) bool DEMFile::load(Handle &hdl)

View File

@ -336,8 +336,8 @@ void Atlas::unload()
for (int i = 0; i < _maps.count(); i++) for (int i = 0; i < _maps.count(); i++)
_maps.at(i)->unload(); _maps.at(i)->unload();
_zooms.clear(); _zooms = QVector<Zoom>();
_bounds.clear(); _bounds = QVector<Bounds>();
} }
Map *Atlas::createTAR(const QString &path, const Projection &proj, bool *isDir) Map *Atlas::createTAR(const QString &path, const Projection &proj, bool *isDir)

View File

@ -125,7 +125,7 @@ void JNXMap::clearTiles()
{ {
for (int i = 0; i < _zooms.size(); i++) { for (int i = 0; i < _zooms.size(); i++) {
Zoom *z = _zooms[i]; Zoom *z = _zooms[i];
z->tiles.clear(); z->tiles = QVector<Tile>();
z->tree.RemoveAll(); z->tree.RemoveAll();
} }
} }

View File

@ -445,7 +445,7 @@ void KMZMap::load(const Projection &in, const Projection &out,
void KMZMap::unload() void KMZMap::unload()
{ {
_bounds.clear(); _bounds = QVector<Bounds>();
delete _zip; delete _zip;
_zip = 0; _zip = 0;

View File

@ -478,7 +478,7 @@ void MapData::clearTiles()
} }
qDeleteAll(_tiles); qDeleteAll(_tiles);
_tiles.clear(); _tiles = QList<TileTree*>();
} }
bool MapData::pathCb(VectorTile *tile, void *context) bool MapData::pathCb(VectorTile *tile, void *context)

View File

@ -763,13 +763,13 @@ void Style::load(const MapData &data, qreal ratio)
void Style::clear() void Style::clear()
{ {
_paths.clear(); _paths = QList<PathRender>();
_circles.clear(); _circles = QList<CircleRender>();
_pathLabels.clear(); _pathLabels = QList<TextRender>();
_pointLabels.clear(); _pointLabels = QList<TextRender>();
_areaLabels.clear(); _areaLabels = QList<TextRender>();
_symbols.clear(); _symbols = QList<Symbol>();
_lineSymbols.clear(); _lineSymbols = QList<Symbol>();
} }
QList<const Style::PathRender *> Style::paths(int zoom, bool closed, QList<const Style::PathRender *> Style::paths(int zoom, bool closed,