diff options
Diffstat (limited to 'plugins/PluginUpdater/src/Common.h')
-rw-r--r-- | plugins/PluginUpdater/src/Common.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/PluginUpdater/src/Common.h b/plugins/PluginUpdater/src/Common.h index 0b07b9098f..7d3bdc7167 100644 --- a/plugins/PluginUpdater/src/Common.h +++ b/plugins/PluginUpdater/src/Common.h @@ -132,6 +132,20 @@ extern HWND hwndDialog; void DoCheck(int iFlag);
void DoGetList(int iFlag);
+struct AutoHandle
+{
+ HANDLE &m_handle;
+
+ AutoHandle(HANDLE &_handle) : m_handle(_handle) {}
+ ~AutoHandle()
+ {
+ if (m_handle) {
+ ::CloseHandle(m_handle);
+ m_handle = 0;
+ }
+ }
+};
+
///////////////////////////////////////////////////////////////////////////////
struct ServListEntry
|