зеркало из https://github.com/mozilla/gecko-dev.git
some fixes for news memory leaks r=mscott 51359
This commit is contained in:
Родитель
21001a9e67
Коммит
f0370e6b85
|
@ -104,6 +104,7 @@ nsresult nsMsgMailNewsUrl::SetUrlState(PRBool aRunningUrl, nsresult aExitCode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_urlListeners->OnStopRunningUrl(this, aExitCode);
|
m_urlListeners->OnStopRunningUrl(this, aExitCode);
|
||||||
|
m_loadGroup = nsnull; // try to break circular refs.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -584,6 +584,7 @@ NS_IMETHODIMP nsNNTPProtocol::Initialize(nsIURI * aURL, nsIMsgWindow *aMsgWindow
|
||||||
m_dataBuf = (char *) PR_Malloc(sizeof(char) * OUTPUT_BUFFER_SIZE);
|
m_dataBuf = (char *) PR_Malloc(sizeof(char) * OUTPUT_BUFFER_SIZE);
|
||||||
m_dataBufSize = OUTPUT_BUFFER_SIZE;
|
m_dataBufSize = OUTPUT_BUFFER_SIZE;
|
||||||
|
|
||||||
|
if (!m_lineStreamBuffer)
|
||||||
m_lineStreamBuffer = new nsMsgLineStreamBuffer(OUTPUT_BUFFER_SIZE, CRLF, PR_TRUE /* create new lines */);
|
m_lineStreamBuffer = new nsMsgLineStreamBuffer(OUTPUT_BUFFER_SIZE, CRLF, PR_TRUE /* create new lines */);
|
||||||
|
|
||||||
m_nextState = SEND_FIRST_NNTP_COMMAND;
|
m_nextState = SEND_FIRST_NNTP_COMMAND;
|
||||||
|
@ -5034,6 +5035,9 @@ nsresult nsNNTPProtocol::ProcessProtocolState(nsIURI * url, nsIInputStream * inp
|
||||||
NS_IMETHODIMP nsNNTPProtocol::CloseConnection()
|
NS_IMETHODIMP nsNNTPProtocol::CloseConnection()
|
||||||
{
|
{
|
||||||
SendData(nsnull, NNTP_CMD_QUIT); // this will cause OnStopRequest get called, which will call CloseSocket()
|
SendData(nsnull, NNTP_CMD_QUIT); // this will cause OnStopRequest get called, which will call CloseSocket()
|
||||||
|
// break some cycles
|
||||||
|
m_newsHost = nsnull;
|
||||||
|
m_nntpServer = nsnull;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5081,7 +5085,18 @@ nsresult nsNNTPProtocol::CleanupAfterRunningUrl()
|
||||||
PR_FREEIF(m_cancelID);
|
PR_FREEIF(m_cancelID);
|
||||||
m_cancelID = nsnull;
|
m_cancelID = nsnull;
|
||||||
|
|
||||||
|
mDisplayInputStream = nsnull;
|
||||||
|
mDisplayOutputStream = nsnull;
|
||||||
|
m_channelListener = nsnull;
|
||||||
|
m_channelContext = nsnull;
|
||||||
|
m_loadGroup = nsnull;
|
||||||
|
mProgressEventSink = nsnull;
|
||||||
|
SetOwner(nsnull);
|
||||||
|
|
||||||
m_runningURL = null_nsCOMPtr();
|
m_runningURL = null_nsCOMPtr();
|
||||||
|
m_url = null_nsCOMPtr();
|
||||||
|
m_originalUrl = null_nsCOMPtr();
|
||||||
|
|
||||||
m_connectionBusy = PR_FALSE;
|
m_connectionBusy = PR_FALSE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -409,10 +409,13 @@ nsNntpIncomingServer::CloseCachedConnections()
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
for (PRUint32 i = 0; i < cnt; i++)
|
for (PRUint32 i = 0; i < cnt; i++)
|
||||||
{
|
{
|
||||||
aSupport = getter_AddRefs(m_connectionCache->ElementAt(i));
|
aSupport = getter_AddRefs(m_connectionCache->ElementAt(0));
|
||||||
connection = do_QueryInterface(aSupport);
|
connection = do_QueryInterface(aSupport);
|
||||||
if (connection)
|
if (connection)
|
||||||
|
{
|
||||||
rv = connection->CloseConnection();
|
rv = connection->CloseConnection();
|
||||||
|
RemoveConnection(connection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rv = WriteNewsrcFile();
|
rv = WriteNewsrcFile();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче