From 56526f02ed82fba884453034d8876424b670bc13 Mon Sep 17 00:00:00 2001 From: leekillough <15950023+leekillough@users.noreply.github.com> Date: Tue, 4 Mar 2025 21:14:18 -0600 Subject: [PATCH] Use std::unique_ptr for modelGen --- src/sst/core/main.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/sst/core/main.cc b/src/sst/core/main.cc index fe4bfb5d3..4d2d14acc 100644 --- a/src/sst/core/main.cc +++ b/src/sst/core/main.cc @@ -293,9 +293,8 @@ start_graph_creation( } } - // Create the model generator - SSTModelDescription* modelGen = nullptr; + std::unique_ptr modelGen; force_rank_sequential_start(cfg.rank_seq_startup(), myRank, world_size); @@ -320,8 +319,8 @@ start_graph_creation( } if ( myRank.rank == 0 || cfg.parallel_load() ) { - modelGen = factory->Create( - model_name, cfg.configFile(), cfg.verbose(), &cfg, sst_get_cpu_time()); + modelGen.reset(factory->Create( + model_name, cfg.configFile(), cfg.verbose(), &cfg, sst_get_cpu_time())); } } @@ -357,12 +356,6 @@ start_graph_creation( } #endif - // Delete the model generator - if ( modelGen ) { - delete modelGen; - modelGen = nullptr; - } - return start_graph_gen; }