Bug 681211 - Attempt to fix a crash in the DOM Memory Reporter when using windows hash table. r=bz
authorMounir Lamouri <mounir.lamouri@gmail.com>
Tue, 30 Aug 2011 11:41:29 +0200
changeset 76212 80a4a3d420eae52fb54d65d0be8e1f76678e17a6
parent 76211 d48ac4bbb8e608cd0ef9a949f144eb7b95069c22
child 76213 2c7e8a50af12494489503bbe23499f6f8d5f0f86
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbz
bugs681211
milestone9.0a1
Bug 681211 - Attempt to fix a crash in the DOM Memory Reporter when using windows hash table. r=bz
dom/base/nsDOMMemoryReporter.cpp
--- a/dom/base/nsDOMMemoryReporter.cpp
+++ b/dom/base/nsDOMMemoryReporter.cpp
@@ -98,13 +98,15 @@ GetWindowsMemoryUsage(const PRUint64& aI
   return PL_DHASH_NEXT;
 }
 
 NS_IMETHODIMP
 nsDOMMemoryReporter::GetAmount(PRInt64* aAmount) {
   *aAmount = 0;
 
   nsGlobalWindow::WindowByIdTable* windows = nsGlobalWindow::GetWindowsTable();
+  NS_ENSURE_TRUE(windows, NS_OK);
+
   windows->Enumerate(GetWindowsMemoryUsage, aAmount);
 
   return NS_OK;
 }