Skip to content

Commit

Permalink
Fix renderer crashing due to SimulationData not being instantiated ea…
Browse files Browse the repository at this point in the history
…rly enough
  • Loading branch information
jacob1 committed Mar 18, 2024
1 parent 8452d96 commit 3fb356e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PowderToyRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ int main(int argc, char *argv[])
auto inputFilename = ByteString(argv[1]);
auto outputFilename = ByteString(argv[2]) + ".png";

auto simulationData = std::make_unique<SimulationData>();

std::vector<char> fileData;
if (!Platform::ReadFile(fileData, inputFilename))
{
Expand All @@ -40,7 +42,6 @@ int main(int argc, char *argv[])
throw e;
}

auto simulationData = std::make_unique<SimulationData>();
Simulation * sim = new Simulation();
Renderer * ren = new Renderer(sim);

Expand Down

0 comments on commit 3fb356e

Please sign in to comment.