use nsILeakDetector service. r=gordon, bug=15906

This commit is contained in:
beard%netscape.com 1999-10-21 00:13:07 +00:00
parent 60c25e67d8
commit 9a212b70a9

View File

@ -16,12 +16,13 @@
* Reserved.
*/
#include <stdlib.h>
#include "nsViewerApp.h"
#include "nsBrowserWindow.h"
#include "nsIImageManager.h"
#include "nsIWidget.h"
#include "nsIServiceManager.h"
#include <stdlib.h>
#include "resources.h"
#include <ToolUtils.h> // MacOS includes
@ -33,7 +34,7 @@
#include <PP_Messages.h> // for PP standard menu commands
#include "nsMacMessagePump.h" // for the windowless menu event handler
#include "nsILeakDetector.h"
#include "macstdlibextras.h"
@ -92,8 +93,6 @@ enum
cmd_ImageInspector
};
extern "C" void GC_gcollect(void);
static nsNativeViewerApp* gTheApp;
@ -321,7 +320,12 @@ nsNativeBrowserWindow::DispatchMenuItem(PRInt32 aID)
::CheckItem(GetMenuHandle(menu_Debug), item_NativeWidgetMode, true);
break;
case cmd_DumpLeaks:
::GC_gcollect();
{
nsresult rv;
NS_WITH_SERVICE(nsILeakDetector, leakDetector, "component://netscape/xpcom/leakdetector", &rv)
if (NS_SUCCEEDED(rv))
leakDetector->DumpLeaks();
}
break;
}
break;