diff --git a/suite/browser/navigator.js b/suite/browser/navigator.js index 4b8909dbba1..08f578b2c74 100644 --- a/suite/browser/navigator.js +++ b/suite/browser/navigator.js @@ -1181,3 +1181,13 @@ function dumpObject( anObject, prefix ) { function dumpExpr( expr ) { dump( expr+"="+eval(expr)+"\n" ); } + +var leakDetector = null; + +// Dumps current set of memory leaks. +function dumpMemoryLeaks() { + if (leakDetector == null) + leakDetector = createInstance("component://netscape/xpcom/leakdetector", "nsILeakDetector"); + if (leakDetector != null) + leakDetector.dumpLeaks(); +} diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 4b8909dbba1..08f578b2c74 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -1181,3 +1181,13 @@ function dumpObject( anObject, prefix ) { function dumpExpr( expr ) { dump( expr+"="+eval(expr)+"\n" ); } + +var leakDetector = null; + +// Dumps current set of memory leaks. +function dumpMemoryLeaks() { + if (leakDetector == null) + leakDetector = createInstance("component://netscape/xpcom/leakdetector", "nsILeakDetector"); + if (leakDetector != null) + leakDetector.dumpLeaks(); +}