summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-09-07 20:03:25 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-09-07 20:03:25 (GMT)
commit8f92e8c069dcb3cb943144864274ee75bad36c0d (patch)
tree90b594cabea3a20d3c62f7f9f99916264dfe9500 /Source/kwsys/SystemTools.cxx
parent2c4b1a1179b148505e22f7816f2b8e90974052c7 (diff)
downloadCMake-8f92e8c069dcb3cb943144864274ee75bad36c0d.zip
CMake-8f92e8c069dcb3cb943144864274ee75bad36c0d.tar.gz
CMake-8f92e8c069dcb3cb943144864274ee75bad36c0d.tar.bz2
Fix leaked file and registry descriptors
Diffstat (limited to 'Source/kwsys/SystemTools.cxx')
-rw-r--r--Source/kwsys/SystemTools.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 2ab0895..3f6ee37 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -401,6 +401,7 @@ bool SystemTools::ReadRegistryValue(const char *key, kwsys_stl::string &value)
if (dwType == REG_SZ)
{
value = data;
+ RegCloseKey(hKey);
return true;
}
}
@@ -564,6 +565,7 @@ bool SystemTools::DeleteRegistryValue(const char *key)
if(RegDeleteValue(hKey,
(LPTSTR)valuename.c_str()) == ERROR_SUCCESS)
{
+ RegCloseKey(hKey);
return true;
}
}