diff options
-rw-r--r-- | base/registry.cc | 4 | ||||
-rw-r--r-- | base/registry.h | 4 | ||||
-rw-r--r-- | chrome/installer/util/create_reg_key_work_item.cc | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/base/registry.cc b/base/registry.cc index d4158df..0040e1a 100644 --- a/base/registry.cc +++ b/base/registry.cc @@ -145,6 +145,10 @@ RegKey::RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access) } } +RegKey::~RegKey() { + Close(); +} + void RegKey::Close() { StopWatching(); if (key_) { diff --git a/base/registry.h b/base/registry.h index a9a6997..4702a78 100644 --- a/base/registry.h +++ b/base/registry.h @@ -22,12 +22,12 @@ class RegKey { public: RegKey(HKEY rootkey = NULL, const wchar_t* subkey = NULL, REGSAM access = KEY_READ); - ~RegKey() { Close(); } + ~RegKey(); bool Create(HKEY rootkey, const wchar_t* subkey, REGSAM access = KEY_READ); bool CreateWithDisposition(HKEY rootkey, const wchar_t* subkey, - DWORD* disposition, REGSAM access = KEY_READ); + DWORD* disposition, REGSAM access); bool Open(HKEY rootkey, const wchar_t* subkey, REGSAM access = KEY_READ); diff --git a/chrome/installer/util/create_reg_key_work_item.cc b/chrome/installer/util/create_reg_key_work_item.cc index 03f3367..c77092f 100644 --- a/chrome/installer/util/create_reg_key_work_item.cc +++ b/chrome/installer/util/create_reg_key_work_item.cc @@ -52,7 +52,7 @@ bool CreateRegKeyWorkItem::Do() { key_path.assign(key_list_[i - 1]); if (key.CreateWithDisposition(predefined_root_, key_path.c_str(), - &disposition)) { + &disposition, KEY_READ)) { if (disposition == REG_OPENED_EXISTING_KEY) { if (key_created_) { // This should not happen. Someone created a subkey under the key |