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

Unified Diff: chrome/browser/media/webrtc_rtp_dump_handler.cc

Issue 322603003: Fix a crash in WebRtcRtpDumpHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | chrome/browser/media/webrtc_rtp_dump_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/webrtc_rtp_dump_handler.cc
diff --git a/chrome/browser/media/webrtc_rtp_dump_handler.cc b/chrome/browser/media/webrtc_rtp_dump_handler.cc
index 7b40ebffabe2169c0d0637616b2de555cbad1500..cad82f98ca4d2b3823bb4719327eee041f6fa343 100644
--- a/chrome/browser/media/webrtc_rtp_dump_handler.cc
+++ b/chrome/browser/media/webrtc_rtp_dump_handler.cc
@@ -330,13 +330,14 @@ void WebRtcRtpDumpHandler::OnDumpEnded(const base::Closure& callback,
}
}
- if (!callback.is_null())
- callback.Run();
-
// Release the writer when it's no longer needed.
if (incoming_state_ != STATE_STOPPING && outgoing_state_ != STATE_STOPPING &&
incoming_state_ != STATE_STARTED && outgoing_state_ != STATE_STARTED) {
dump_writer_.reset();
--g_ongoing_rtp_dumps;
}
+
+ // This object might be deleted after running the callback.
+ if (!callback.is_null())
+ callback.Run();
}
« no previous file with comments | « no previous file | chrome/browser/media/webrtc_rtp_dump_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698