CloseOutputStream();
if (m_fileStream) { m_fileStream->close(); delete m_fileStream; m_fileStream = nsnull; }  if (m_messageService) { ReleaseMessageServiceFromURI(m_baseMessageUri, m_messageService); m_messageService = nsnull; }
nsFolderCompactState::~nsFolderCompactState(){  CloseOutputStream();  if (m_baseMessageUri)  {    nsCRT::free(m_baseMessageUri);    m_baseMessageUri = nsnull;  }  if (NS_FAILED(m_status))  {    CleanupTempFilesAfterError();    // if for some reason we failed remove the temp folder and database  }}