From a49bbb28e98abc5fcd34bfedf7011bce52a605b2 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Wed, 8 Dec 1999 04:33:44 +0000 Subject: [PATCH] fix memory leak for webshell! Bug #21126 --> ftp was broken with mail window up r=sspitzer git-svn-id: svn://10.0.0.236/trunk@55712 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/src/nsMsgWindow.cpp | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/mozilla/mailnews/base/src/nsMsgWindow.cpp b/mozilla/mailnews/base/src/nsMsgWindow.cpp index 7b913cb6a63..c0c3ddbad1e 100644 --- a/mozilla/mailnews/base/src/nsMsgWindow.cpp +++ b/mozilla/mailnews/base/src/nsMsgWindow.cpp @@ -179,7 +179,10 @@ NS_IMETHODIMP nsMsgWindow::SetDOMWindow(nsIDOMWindow *aWindow) nsAutoString webShellName("messagepane"); - rv = mRootWebShell->FindChildWithName(webShellName.GetUnicode(), mMessageWindowWebShell); + nsCOMPtr msgWebShell; + rv = mRootWebShell->FindChildWithName(webShellName.GetUnicode(), *getter_AddRefs(msgWebShell)); + // we don't own mMessageWindowWebShell so don't try to keep a reference to it! + mMessageWindowWebShell = msgWebShell; } return rv; } @@ -233,6 +236,10 @@ NS_IMETHODIMP nsMsgWindow::CanHandleContent(const char * aContentType, // incoming Type Preferred type // text/html // text/xul + // image/gif + // image/jpeg + // image/png + // image/tiff *aCanHandleContent = PR_FALSE; @@ -254,7 +261,24 @@ NS_IMETHODIMP nsMsgWindow::CanHandleContent(const char * aContentType, // for right now, if the load command is viewNormal just say we can handle it... if (aCommand == nsIURILoader::viewNormal) + { + if (nsCRT::strcasecmp(aContentType, "multipart/x-mixed-replace") == 0) + { + *aDesiredContentType = nsCRT::strdup("text/html"); *aCanHandleContent = PR_TRUE; + } + if (nsCRT::strcasecmp(aContentType, "text/html") == 0 + || nsCRT::strcasecmp(aContentType, "text/xul") == 0 + || nsCRT::strcasecmp(aContentType, "text/rdf") == 0 + || nsCRT::strcasecmp(aContentType, "text/xml") == 0 + || nsCRT::strcasecmp(aContentType, "text/css") == 0 + || nsCRT::strcasecmp(aContentType, "image/gif") == 0 + || nsCRT::strcasecmp(aContentType, "image/jpeg") == 0 + || nsCRT::strcasecmp(aContentType, "image/png") == 0 + || nsCRT::strcasecmp(aContentType, "image/tiff") == 0 + || nsCRT::strcasecmp(aContentType, "application/http-index-format") == 0) + *aCanHandleContent = PR_TRUE; + } } return NS_OK;