[Lldb-commits] [PATCH] D74010: Fix BroadcasterManager::RemoveListener to really remove the listener

Reid Kleckner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 4 16:59:20 PST 2020


rnk created this revision.
rnk added reviewers: JDevlieghere, amccarth.
Herald added a project: LLDB.

This appears to be a real bug caught by -Wunused-value. std::find_if
doesn't modify the underlying collection, it just returns an iterator
pointing to the matching element.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74010

Files:
  lldb/source/Utility/Broadcaster.cpp


Index: lldb/source/Utility/Broadcaster.cpp
===================================================================
--- lldb/source/Utility/Broadcaster.cpp
+++ lldb/source/Utility/Broadcaster.cpp
@@ -406,7 +406,7 @@
   listener_collection::iterator iter = m_listeners.begin(),
                                 end_iter = m_listeners.end();
 
-  std::find_if(iter, end_iter, predicate);
+  iter = std::find_if(iter, end_iter, predicate);
   if (iter != end_iter)
     m_listeners.erase(iter);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74010.242471.patch
Type: text/x-patch
Size: 489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200205/16b32ad6/attachment.bin>


More information about the lldb-commits mailing list