mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[ATL] Close m_hKey in CRegKey destructor and when attaching to a new key (#3764)
This commit is contained in:
parent
aa2697df2d
commit
42e111f26b
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue