Index: chrome/browser/metrics/thread_watcher.cc |
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc |
index 84a00ae4e45f32c74fe06ff11da31ca4f7e64500..6d1ecda6cb5519103f7d88022932866eb0182c7c 100644 |
--- a/chrome/browser/metrics/thread_watcher.cc |
+++ b/chrome/browser/metrics/thread_watcher.cc |
@@ -84,8 +84,10 @@ void ThreadWatcher::StartWatching(const WatchingParams& params) { |
DCHECK(watcher); |
// If we couldn't register the thread watcher object, we are shutting down, |
// then don't activate thread watching. |
- if (!ThreadWatcherList::IsRegistered(params.thread_id)) |
+ if (!ThreadWatcherList::IsRegistered(params.thread_id)) { |
+ delete watcher; |
Ilya Sherman
2016/08/30 23:51:57
Could you instead modify |watcher| to be a unique_
|
return; |
+ } |
watcher->ActivateThreadWatching(); |
alokp
2016/08/30 22:32:34
Is this leaked?
ramant (doing other things)
2016/08/30 22:45:12
watcher is stored in g_thread_watcher_list_. It is
alokp
2016/08/30 22:47:21
Thanks for the explanation. I think a comment abou
|
} |