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