From e44fb9257a0e747418eda7ae254ac761147b6d65 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 1 Jan 2018 13:05:03 +0200 Subject: Fix lifetime issue in progress monitoring logic --- build2/operation.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'build2/operation.cxx') diff --git a/build2/operation.cxx b/build2/operation.cxx index 82b546c..698edbb 100644 --- a/build2/operation.cxx +++ b/build2/operation.cxx @@ -124,8 +124,8 @@ namespace build2 // Setup progress reporting if requested. // + string what; // Note: must outlive monitor_guard. scheduler::monitor_guard mg; - string what; if (ops.progress () || (stderr_term && verb >= 1 && verb <= 2 && !ops.no_progress ())) { @@ -273,8 +273,9 @@ namespace build2 // Setup progress reporting if requested. // + string what; // Note: must outlive monitor_guard. scheduler::monitor_guard mg; - string what; + if (ops.progress () || (stderr_term && verb == 1 && !ops.no_progress ())) { size_t init (target_count.load (memory_order_relaxed)); -- cgit v1.1