Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1226)

Unified Diff: mojo/edk/system/raw_channel.cc

Issue 1589693002: Avoid shutdown leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/raw_channel.cc
diff --git a/mojo/edk/system/raw_channel.cc b/mojo/edk/system/raw_channel.cc
index 5d0a04c47273dfddbfaa8c02f66bac8b4bd11205..93c2d05d61f4a97c7050d26cdbc9ffc196c65806 100644
--- a/mojo/edk/system/raw_channel.cc
+++ b/mojo/edk/system/raw_channel.cc
@@ -726,8 +726,13 @@ void RawChannel::CallOnReadCompleted(IOResult io_result, size_t bytes_read) {
}
void RawChannel::WillDestroyCurrentMessageLoop() {
- base::AutoLock locker(read_lock_);
- OnReadCompletedNoLock(IO_FAILED_SHUTDOWN, 0);
+ {
+ base::AutoLock locker(read_lock_);
+ OnReadCompletedNoLock(IO_FAILED_SHUTDOWN, 0);
+ }
+ // The PostTask inside Shutdown() will never be called, so manually call it
+ // here to avoid leaks in LSAN builds.
+ Shutdown();
}
} // namespace edk
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698