Skip to content

Commit

Permalink
#5374: Fix crash in Map::exportSelected due to a beginner's fault, pa…
Browse files Browse the repository at this point in the history
…ssing a reference to an instance that is about to be deleted as soon as the call returns.
  • Loading branch information
codereader committed Nov 1, 2020
1 parent 4d1d5d2 commit a729e93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion radiantcore/map/Map.cpp
Expand Up @@ -814,7 +814,8 @@ void Map::exportSelected(std::ostream& out, const MapFormatPtr& format)
assert(format);

// Create our main MapExporter walker for traversal
MapExporter exporter(*format->getMapWriter(), GlobalSceneGraph().root(), out);
auto writer = format->getMapWriter();
MapExporter exporter(*writer, GlobalSceneGraph().root(), out);

// Pass the traverseSelected function and start writing selected nodes
exporter.exportMap(GlobalSceneGraph().root(), scene::traverseSelected);
Expand Down

0 comments on commit a729e93

Please sign in to comment.