projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa2697d
)
[ATL] Close m_hKey in CRegKey destructor and when attaching to a new key (#3764)
author
He Yang
<1160386205@qq.com>
Thu, 24 Jun 2021 21:50:01 +0000
(
03:20
+0530)
committer
GitHub
<noreply@github.com>
Thu, 24 Jun 2021 21:50:01 +0000
(23:50 +0200)
sdk/lib/atl/atlbase.h
patch
|
blob
|
history
diff --git
a/sdk/lib/atl/atlbase.h
b/sdk/lib/atl/atlbase.h
index
fa3cf72
..
502d7b1
100644
(file)
--- a/
sdk/lib/atl/atlbase.h
+++ b/
sdk/lib/atl/atlbase.h
@@
-1043,6
+1043,7
@@
public:
~CRegKey() throw()
{
+ Close();
}
void Attach(HKEY hKey) throw()
@@
-1359,7
+1360,11
@@
public:
CRegKey& operator=(CRegKey& key) throw()
{
- Attach(key.Detach());
+ if (m_hKey != key.m_hKey)
+ {
+ Close();
+ Attach(key.Detach());
+ }
return *this;
}