NS_RELEASE(m_newsDB); m_newsDB = nsnull;
nsresult newsTestDriver::RunDriver(){    nsresult rv = NS_OK;    rv = GetDatabase();    if (NS_SUCCEEDED(rv) && m_newsDB) {        nsIMsgDBHdr		*newMsgHdr = nsnull;        m_newsDB->CreateNewHdr(1, &newMsgHdr);        if (NS_FAILED(rv)) {#ifdef DEBUG            printf("m_newsDB->CreateNewHdr() failed\n");#endif            return rv;        }        newMsgHdr->SetSubject("hello, world");        newMsgHdr->SetFlags(MSG_FLAG_READ);        newMsgHdr->SetAuthor("zelig@allen.com");        rv = m_newsDB->AddNewHdrToDB(newMsgHdr, PR_TRUE);        if (NS_FAILED(rv)) {#ifdef DEBUG            printf("m_newsDB->AddNewHdrToDB() failed\n");#endif            return rv;                   }                newMsgHdr->Release();        newMsgHdr = nsnull;       	/* closing the newsDB isn't enough.  something still has	 * reference to it.  (need to look into this, bienvenu 	 * suggests nsMsgFolderInfo?)	 * for now, we need to Commit() to force the changes	 * to the disk	 */        m_newsDB->Commit(kSessionCommit);        m_newsDB->Close(PR_TRUE);    }    NS_RELEASE(m_newsDB);    m_newsDB = nsnull;        return rv;}