From cdb0268387f40fcc18964e3c9d38679bfad7ff76 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 10 Apr 2013 18:07:58 +0200 Subject: [PATCH] Close opened registry key Signed-off-by: Sven Strickroth --- src/Utils/MiscUI/MessageBox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Utils/MiscUI/MessageBox.cpp b/src/Utils/MiscUI/MessageBox.cpp index ab228a86f..1a80bd69a 100644 --- a/src/Utils/MiscUI/MessageBox.cpp +++ b/src/Utils/MiscUI/MessageBox.cpp @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2012 - TortoiseGit +// Copyright (C) 2012-2013 - TortoiseGit // Copyright (C) 2003-2008,2010 - TortoiseSVN // This program is free software; you can redistribute it and/or @@ -254,7 +254,11 @@ bool CMessageBox::RemoveRegistryKey(LPCTSTR lpRegistry) path += AfxGetAppName(); #endif if (RegOpenKeyEx(HKEY_CURRENT_USER, path, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS) - return !!RegDeleteValue(hKey, lpRegistry); + { + bool ret = !!RegDeleteValue(hKey, lpRegistry); + RegCloseKey(hKey); + return ret; + } return false; } -- 2.11.4.GIT