diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index add7e65857f..fea2ae70be7 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -86,8 +86,15 @@ static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID); #ifdef DEBUG #undef NOISY_LINKS +#undef NOISY_WEBSHELL_LEAKS #else #undef NOISY_LINKS +#undef NOISY_WEBSHELL_LEAKS +#endif + +#ifdef NOISY_WEBSHELL_LEAKS +#undef DETECT_WEBSHELL_LEAKS +#define DETECT_WEBSHELL_LEAKS #endif #ifdef NS_DEBUG @@ -609,13 +616,19 @@ nsresult nsWebShell::DestroyPluginHost(void) //---------------------------------------------------------------------- +MOZ_DECL_CTOR(nsWebShell); + // Note: operator new zeros our memory nsWebShell::nsWebShell() { + MOZ_CTOR(nsWebShell); #ifdef DETECT_WEBSHELL_LEAKS // We're counting the number of |nsWebShells| to help find leaks ++gNumberOfWebShells; #endif +#ifdef NOISY_WEBSHELL_LEAKS + printf("WEBSHELL+ = %d\n", gNumberOfWebShells); +#endif NS_INIT_REFCNT(); mHistoryIndex = -1; @@ -643,6 +656,7 @@ nsWebShell::nsWebShell() nsWebShell::~nsWebShell() { + MOZ_DTOR(nsWebShell); if (nsnull != mHistoryService) { nsServiceManager::ReleaseService(kGlobalHistoryCID, mHistoryService); mHistoryService = nsnull; @@ -703,6 +717,9 @@ nsWebShell::~nsWebShell() // We're counting the number of |nsWebShells| to help find leaks --gNumberOfWebShells; #endif +#ifdef NOISY_WEBSHELL_LEAKS + printf("WEBSHELL- = %d\n", gNumberOfWebShells); +#endif } void nsWebShell::InitFrameData(PRBool aCompleteInitScrolling) diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index add7e65857f..fea2ae70be7 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -86,8 +86,15 @@ static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID); #ifdef DEBUG #undef NOISY_LINKS +#undef NOISY_WEBSHELL_LEAKS #else #undef NOISY_LINKS +#undef NOISY_WEBSHELL_LEAKS +#endif + +#ifdef NOISY_WEBSHELL_LEAKS +#undef DETECT_WEBSHELL_LEAKS +#define DETECT_WEBSHELL_LEAKS #endif #ifdef NS_DEBUG @@ -609,13 +616,19 @@ nsresult nsWebShell::DestroyPluginHost(void) //---------------------------------------------------------------------- +MOZ_DECL_CTOR(nsWebShell); + // Note: operator new zeros our memory nsWebShell::nsWebShell() { + MOZ_CTOR(nsWebShell); #ifdef DETECT_WEBSHELL_LEAKS // We're counting the number of |nsWebShells| to help find leaks ++gNumberOfWebShells; #endif +#ifdef NOISY_WEBSHELL_LEAKS + printf("WEBSHELL+ = %d\n", gNumberOfWebShells); +#endif NS_INIT_REFCNT(); mHistoryIndex = -1; @@ -643,6 +656,7 @@ nsWebShell::nsWebShell() nsWebShell::~nsWebShell() { + MOZ_DTOR(nsWebShell); if (nsnull != mHistoryService) { nsServiceManager::ReleaseService(kGlobalHistoryCID, mHistoryService); mHistoryService = nsnull; @@ -703,6 +717,9 @@ nsWebShell::~nsWebShell() // We're counting the number of |nsWebShells| to help find leaks --gNumberOfWebShells; #endif +#ifdef NOISY_WEBSHELL_LEAKS + printf("WEBSHELL- = %d\n", gNumberOfWebShells); +#endif } void nsWebShell::InitFrameData(PRBool aCompleteInitScrolling)