Bug 770491 - Fix leak introduced by System Message Handler API. r=khuey
authorMounir Lamouri <mounir.lamouri@gmail.com>
Tue, 03 Jul 2012 15:49:56 +0200
changeset 98191 7ae505066ea780fa7ffb4a9a8563cbc824e22314
parent 98190 da871640d4486b3149671987877e278e8cda5a00
child 98192 032188386b9efc55223772c1360e84e623a0bca5
push id23036
push userryanvm@gmail.com
push dateTue, 03 Jul 2012 23:04:46 +0000
treeherdermozilla-central@477d807660d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs770491
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 770491 - Fix leak introduced by System Message Handler API. r=khuey
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -10673,24 +10673,19 @@ nsGlobalWindow::SetIsApp(bool aValue)
   MOZ_ASSERT(mIsApp == TriState_Unknown);
 
   mIsApp = aValue ? TriState_True : TriState_False;
 }
 
 bool
 nsGlobalWindow::IsPartOfApp()
 {
-  mozIDOMApplication* app;
-  nsresult rv = GetApp(&app);
-
-  if (NS_FAILED(rv)) {
-    return false;
-  }
-
-  return app != nsnull;
+  nsCOMPtr<mozIDOMApplication> app;
+
+  return NS_SUCCEEDED(GetApp(getter_AddRefs(app))) ? app != nsnull : false;
 }
 
 nsresult
 nsGlobalWindow::SetApp(const nsAString& aManifestURL)
 {
   // SetIsApp(true) should be called before calling SetApp().
   if (mIsApp != TriState_True) {
     MOZ_ASSERT(false);