================
@@ -30,18 +34,19 @@ Progress::~Progress() {
   // Make sure to always report progress completed when this object is
   // destructed so it indicates the progress dialog/activity should go away.
   std::lock_guard<std::mutex> guard(m_mutex);
-  if (!m_completed)
-    m_completed = m_total;
+  if (m_total.has_value() && !m_completed)
+    m_completed = m_total.value();
   ReportProgress();
 }
 
 void Progress::Increment(uint64_t amount, std::string update) {
   if (amount > 0) {
     std::lock_guard<std::mutex> guard(m_mutex);
+    m_details = update;
----------------
clayborg wrote:

We should probably make `std::string update` into `std::optional<std::string> 
updated_detail` as we default this argument to an empty string currently and 
the first call to this function from the DWARF indexer will then clear the 
DWARF path since `update` will be empty. Now that `m_details` is the only thing 
that holds onto the filename for all progresses, we don't want the 
`Increment(...)` call to result the m_details. This code will now need to be:
```
if (updated_detail)
  m_details = *updated_detail;
```


https://github.com/llvm/llvm-project/pull/77547
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to