Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8.1, 0.8.2, and 0.8.3

shellext: close reg key in error case

Changeset 3c9b044556b7

Parent a0844bf36a11

by Adrian Buehlmann

Changes to one file · Browse files at 3c9b044556b7 Showing diff from parent a0844bf36a11 Diff from another changeset...

 
152
153
154
155
 
 
 
 
 
 
156
157
158
159
160
161
162
163
164
 
 
165
166
167
 
152
153
154
 
155
156
157
158
159
160
161
162
 
163
164
 
 
 
 
165
166
167
168
169
@@ -152,16 +152,18 @@
  LONG rv = RegOpenKeyExA(   HKEY_CURRENT_USER, subkey.c_str(), 0, KEY_READ, &hkey);   - if (rv != ERROR_SUCCESS || !hkey) + if (rv == ERROR_SUCCESS && hkey) + { + GetRegSZValue(hkey, "menuText", menuText); + GetRegSZValue(hkey, "helpText", helpText); + } + else   {   TDEBUG_TRACE("GetCMenuTranslation: RegOpenKeyExA(" << subkey << ") failed"); - return;   }   - GetRegSZValue(hkey, "menuText", menuText); - GetRegSZValue(hkey, "helpText", helpText); - - RegCloseKey(hkey); + if (hkey) + RegCloseKey(hkey);  }