X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89077ebcc8990c84d94a601b221210d3ff7a8ec7..d311155fa2c85587286ea271bd5c9546faf9aa90:/src/msw/regconf.cpp diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 4bc56da8b6..8943720d8f 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -528,16 +528,15 @@ bool wxRegConfig::DeleteAll() { m_keyLocal.Close(); m_keyGlobal.Close(); -#if 1 - wxFAIL_MSG("wxRegConfig::DeleteAll will wipe out your entire registry, so please do not use until it's fixed!"); - return FALSE; -#else + bool bOk = m_keyLocalRoot.DeleteSelf(); - if ( bOk ) + + // make sure that we opened m_keyGlobalRoot and so it has a reasonable name: + // otherwise we will delete HKEY_CLASSES_ROOT recursively + if ( bOk && m_keyGlobalRoot.IsOpened() ) bOk = m_keyGlobalRoot.DeleteSelf(); return bOk; -#endif } #endif