]> git.saurik.com Git - wxWidgets.git/commitdiff
don't give error msg when deleting non existing keys neither (part of patch 830049)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 28 Oct 2003 10:55:05 +0000 (10:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 28 Oct 2003 10:55:05 +0000 (10:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/registry.cpp

index 8305c63eb8f03e0233ff9cbe413eec135d388f2e..0c0cda7752f5830771a73d3265f091a4cc2cea20 100644 (file)
@@ -683,7 +683,9 @@ bool wxRegKey::DeleteSelf()
   Close();
 
   m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey);
-  if ( m_dwLastError != ERROR_SUCCESS ) {
+  // deleting a key which doesn't exist is not considered an error
+  if ( m_dwLastError != ERROR_SUCCESS &&
+          m_dwLastError !- ERROR_FILE_NOT_FOUND ) {
     wxLogSysError(m_dwLastError, _("Can't delete key '%s'"),
                   GetName().c_str());
     return FALSE;