From 3928193dd57ccc4afa48abf097d4fc05bc69688e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Oct 2000 20:29:36 +0000 Subject: [PATCH] fixed false alert in wxRegKey::DeleteSelf (backported from the main branch) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/registry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 369db0706e..075e99e0d1 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -617,8 +617,9 @@ bool wxRegKey::DeleteSelf() // prevent a buggy program from erasing one of the root registry keys or an // immediate subkey (i.e. one which doesn't have '\\' inside) of any other // key except HKCR (HKCR has some "deleteable" subkeys) - if ( m_strKey.IsEmpty() || (m_hRootKey != HKCR && - m_strKey.Find(REG_SEPARATOR) == wxNOT_FOUND) ) { + if ( m_strKey.IsEmpty() || + ((m_hRootKey != (WXHKEY) aStdKeys[HKCR].hkey) && + (m_strKey.Find(REG_SEPARATOR) == wxNOT_FOUND)) ) { wxLogError(_("Registry key '%s' is needed for normal system operation,\ndeleting it will leave your system in unusable state:\noperation aborted."), GetFullName(this)); return FALSE;