From 2acff9c8222b6b90d4748eda97a113229dbc9084 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Mon, 26 Mar 2018 13:36:34 +0200 Subject: [PATCH] Fix potential memory leak. --- src/tools/launcher.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tools/launcher.cpp b/src/tools/launcher.cpp index 92f3437..a76d256 100644 --- a/src/tools/launcher.cpp +++ b/src/tools/launcher.cpp @@ -99,9 +99,9 @@ void Launcher::start() return; } - auto executable = wrap_string(fmriChooser.get_file()->get_path()); - auto network = wrap_string(modelChooser.get_file()->get_path()); - auto weights = wrap_string(weightsChooser.get_file()->get_path()); + auto executable = fmriChooser.get_file()->get_path(); + auto network = modelChooser.get_file()->get_path(); + auto weights = weightsChooser.get_file()->get_path(); auto inputs = getInputFiles(); if (inputs.empty()) { @@ -111,11 +111,11 @@ void Launcher::start() } std::vector argv = { - executable, + wrap_string(executable), wrap_string("-n"), - network, + wrap_string(network), wrap_string("-w"), - weights, + wrap_string(weights), }; if (labelChooser.get_file()) { @@ -133,7 +133,7 @@ void Launcher::start() argv.push_back(nullptr); - execv(executable, argv.data()); + execv(executable.c_str(), argv.data()); } bool Launcher::hasFile(const Gtk::FileChooserButton& fileChooser, const std::string& error)