fix crash cancelling fcc to imap folder, sr=mscott, patch suggested by laurentiu dumitrescu 206408

This commit is contained in:
bienvenu%nventure.com 2006-10-06 20:55:43 +00:00
Родитель 58dc8f7d70
Коммит 837dc6202b
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -1652,9 +1652,14 @@ nsresult nsImapProtocol::SendData(const char * dataBuffer, PRBool aSuppressLoggi
else
Log("SendData", nsnull, "Logging suppressed for this command (it probably contained authentication information)");
PRUint32 n;
rv = m_outputStream->Write(dataBuffer, PL_strlen(dataBuffer), &n);
{
// don't allow someone to close the stream/transport out from under us
// this can happen when the ui thread calls TellThreadToDie.
nsAutoCMonitor mon(this);
PRUint32 n;
if (m_outputStream)
rv = m_outputStream->Write(dataBuffer, PL_strlen(dataBuffer), &n);
}
if (NS_FAILED(rv))
{
Log("SendData", nsnull, "clearing IMAP_CONNECTION_IS_OPEN");