Skip to content

Commit

Permalink
Free the QVector/QList memory where memory should be released
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Sep 28, 2024
1 parent 5d86852 commit 7b516ca
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/map/IMG/demfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static qint16 limit(const DEMTile *tile, quint16 factor)

void DEMFile::clear()
{
_levels.clear();
_levels = QVector<Level>();
}

bool DEMFile::load(Handle &hdl)
Expand Down
4 changes: 2 additions & 2 deletions src/map/atlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ void Atlas::unload()
for (int i = 0; i < _maps.count(); i++)
_maps.at(i)->unload();

_zooms.clear();
_bounds.clear();
_zooms = QVector<Zoom>();
_bounds = QVector<Bounds>();
}

Map *Atlas::createTAR(const QString &path, const Projection &proj, bool *isDir)
Expand Down
2 changes: 1 addition & 1 deletion src/map/jnxmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void JNXMap::clearTiles()
{
for (int i = 0; i < _zooms.size(); i++) {
Zoom *z = _zooms[i];
z->tiles.clear();
z->tiles = QVector<Tile>();
z->tree.RemoveAll();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/map/kmzmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void KMZMap::load(const Projection &in, const Projection &out,

void KMZMap::unload()
{
_bounds.clear();
_bounds = QVector<Bounds>();

delete _zip;
_zip = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/map/mapsforge/mapdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void MapData::clearTiles()
}

qDeleteAll(_tiles);
_tiles.clear();
_tiles = QList<TileTree*>();
}

bool MapData::pathCb(VectorTile *tile, void *context)
Expand Down
14 changes: 7 additions & 7 deletions src/map/mapsforge/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,13 @@ void Style::load(const MapData &data, qreal ratio)

void Style::clear()
{
_paths.clear();
_circles.clear();
_pathLabels.clear();
_pointLabels.clear();
_areaLabels.clear();
_symbols.clear();
_lineSymbols.clear();
_paths = QList<PathRender>();
_circles = QList<CircleRender>();
_pathLabels = QList<TextRender>();
_pointLabels = QList<TextRender>();
_areaLabels = QList<TextRender>();
_symbols = QList<Symbol>();
_lineSymbols = QList<Symbol>();
}

QList<const Style::PathRender *> Style::paths(int zoom, bool closed,
Expand Down

0 comments on commit 7b516ca

Please sign in to comment.