Fix for bug 78967. Need to add an extra nsCOMPtr to avoid to be self detroyed. R=varada, SR=sspitzer

This commit is contained in:
ducarroz%netscape.com 2001-05-09 04:00:25 +00:00
Родитель 354a857abc
Коммит 9cefecbcc0
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -1126,6 +1126,15 @@ nsMsgAttachmentHandler::GetMimeDeliveryState(nsIMsgSend** _retval)
nsresult
nsMsgAttachmentHandler::SetMimeDeliveryState(nsIMsgSend* mime_delivery_state)
{
/*
Because setting m_mime_delivery_state to null could destroy ourself as
m_mime_delivery_state it's our parent, we need to protect ourself against
that!
This extra comptr is necessary,
see bug http://bugzilla.mozilla.org/show_bug.cgi?id=78967
*/
nsCOMPtr<nsIMsgSend> temp = m_mime_delivery_state; /* Should lock our parent until the end of the function */
m_mime_delivery_state = mime_delivery_state;
return NS_OK;
}