Skip to content
Snippets Groups Projects
Commit 8e00f3ae authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[GL/IO] Avoid use after move.

Points were accessed and moved in a for-loop. Second
iteration would result in access after move.
parent 29a54a30
No related branches found
No related tags found
No related merge requests found
......@@ -45,12 +45,10 @@ bool BoostXmlGmlInterface::readFile(const std::string &fname)
doc->ignoreConfigAttribute("xsi:noNamespaceSchemaLocation");
doc->ignoreConfigAttribute("xmlns:ogs");
auto points = std::make_unique<std::vector<GeoLib::Point*>>();
auto polylines = std::make_unique<std::vector<GeoLib::Polyline*>>();
auto surfaces = std::make_unique<std::vector<GeoLib::Surface*>>();
using MapNameId = std::map<std::string, std::size_t>;
auto pnt_names = std::make_unique<MapNameId>();
auto ply_names = std::make_unique<MapNameId>();
auto sfc_names = std::make_unique<MapNameId>();
......@@ -64,6 +62,8 @@ bool BoostXmlGmlInterface::readFile(const std::string &fname)
//! \ogs_file_param{gml__points}
for (auto st : doc->getConfigSubtreeList("points"))
{
auto points = std::make_unique<std::vector<GeoLib::Point*>>();
auto pnt_names = std::make_unique<MapNameId>();
readPoints(st, *points, *pnt_names);
_geo_objects.addPointVec(std::move(points), geo_name,
std::move(pnt_names));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment