summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 18:56:14 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 18:56:14 +0000
commit1b8529fc4cee70ff464817fe0abc01689a5f3cb5 (patch)
treef917a27b6e7ece6b6dd40e81d596e95f1ec7a1be
parent513276f41ca989762139ccf87852be28d4f54dcc (diff)
downloadchromium_src-1b8529fc4cee70ff464817fe0abc01689a5f3cb5.zip
chromium_src-1b8529fc4cee70ff464817fe0abc01689a5f3cb5.tar.gz
chromium_src-1b8529fc4cee70ff464817fe0abc01689a5f3cb5.tar.bz2
Fix the MediaDeviceNotificationLinux leak by releasing it before the FILE thread goes away.
BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10695193 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147057 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chrome_browser_main_linux.cc11
-rw-r--r--chrome/browser/chrome_browser_main_linux.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc
index 1d1b621..00225304 100644
--- a/chrome/browser/chrome_browser_main_linux.cc
+++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -98,3 +98,14 @@ void ChromeBrowserMainPartsLinux::PreProfileInit() {
ChromeBrowserMainPartsPosix::PreProfileInit();
}
+
+void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() {
+#if !defined(OS_CHROMEOS)
+ // Release it now. Otherwise the FILE thread would be gone when we try to
+ // release it in the dtor and Valgrind would report a leak on almost ever
+ // single browser_test.
+ media_device_notifications_linux_ = NULL;
+#endif
+
+ ChromeBrowserMainPartsPosix::PostMainMessageLoopRun();
+}
diff --git a/chrome/browser/chrome_browser_main_linux.h b/chrome/browser/chrome_browser_main_linux.h
index 5098aee..4f99377 100644
--- a/chrome/browser/chrome_browser_main_linux.h
+++ b/chrome/browser/chrome_browser_main_linux.h
@@ -25,6 +25,7 @@ class ChromeBrowserMainPartsLinux : public ChromeBrowserMainPartsPosix {
// ChromeBrowserMainParts overrides.
virtual void PreProfileInit() OVERRIDE;
+ virtual void PostMainMessageLoopRun() OVERRIDE;
private:
#if !defined(OS_CHROMEOS)