aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/WinTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32/WinTypes.h')
-rw-r--r--win32/WinTypes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/win32/WinTypes.h b/win32/WinTypes.h
index c0d6c558d..f2bbfd5f9 100644
--- a/win32/WinTypes.h
+++ b/win32/WinTypes.h
@@ -52,6 +52,13 @@ inline T DLLFunction(HMODULE hModule, LPCSTR lpProcName) noexcept {
return fp;
}
+inline void ReleaseLibrary(HMODULE &hLib) noexcept {
+ if (hLib) {
+ FreeLibrary(hLib);
+ hLib = {};
+ }
+}
+
}
#endif