void UnitTest::DeleteInstance() { if (pInstance_ != 0) { #if defined(WIN32) if (pInstance_->HasDialog()) { pInstance_->Dialog()->Destroy(); // Auto delete in WM_DESTROY //delete pDlg_; //pDlg_ = 0; if (g_hRichEditDll != NULL) { ::FreeLibrary(g_hRichEditDll); g_hRichEditDll = NULL; } } #endif // defined(WIN32) } if (pInstance_ != 0) { delete pInstance_; pInstance_ = 0; } }