mirror of
https://github.com/reactos/reactos.git
synced 2026-05-27 19:33:55 +08:00
[ATL] Close m_hKey in CRegKey destructor and when attaching to a new key (#3764)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user