From c3284e4a312ab1b32e90b00457581bcd2c39a027 Mon Sep 17 00:00:00 2001 From: Alanko Jarno N Date: Wed, 16 Oct 2024 10:39:48 +0300 Subject: [PATCH] Initialize pointers (fixes issue #37) --- src/mSWEEP.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mSWEEP.cpp b/src/mSWEEP.cpp index daa3020..a153693 100644 --- a/src/mSWEEP.cpp +++ b/src/mSWEEP.cpp @@ -285,7 +285,7 @@ int main (int argc, char *argv[]) { // `Sample` and its children are classes for storing data from // the pseudoalignment that are needed or not needed depending on // the command line arguments. - std::unique_ptr sample; + std::unique_ptr sample = std::make_unique(); bool bootstrap_mode = args.value("iters") > (size_t)0; bool bin_reads = args.value("bin-reads"); @@ -362,6 +362,7 @@ int main (int argc, char *argv[]) { } cxxio::In infile(args.value("read-likelihood")); + log_likelihoods = std::make_unique>(); log_likelihoods->from_file(reference->n_groups(i), &infile.stream()); } catch (std::exception &e) { finalize("Reading the likelihoods failed:\n " + std::string(e.what()) + "\nexiting\n", log, true);