From 4b6cb0b8b8a8fa4856f6bcacf7e4f9e5047542c4 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Thu, 16 Oct 2014 12:10:12 +0200 Subject: [PATCH] replace raw ptrs with std::unique_ptr<> in Prepare --- Contractor/Prepare.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Contractor/Prepare.cpp b/Contractor/Prepare.cpp index cea5e2f90..ceddbbac0 100644 --- a/Contractor/Prepare.cpp +++ b/Contractor/Prepare.cpp @@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../Util/GitDescription.h" #include "../Util/LuaUtil.h" +#include "../Util/make_unique.hpp" #include "../Util/OSRMException.h" #include "../Util/simple_logger.hpp" #include "../Util/StringUtil.h" @@ -194,7 +195,7 @@ int Prepare::Process(int argc, char *argv[]) */ SimpleLogger().Write() << "initializing contractor"; - Contractor *contractor = new Contractor(number_of_edge_based_nodes, edge_based_edge_list); + auto contractor = osrm::make_unique(number_of_edge_based_nodes, edge_based_edge_list); TIMER_START(contraction); contractor->Run(); @@ -204,7 +205,7 @@ int Prepare::Process(int argc, char *argv[]) DeallocatingVector contracted_edge_list; contractor->GetEdges(contracted_edge_list); - delete contractor; + contractor.reset(); /*** * Sorting contracted edges in a way that the static query graph can read some in in-place.