[glib: 2/3] Don't leak a handle from _g_io_win32_get_module()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 2/3] Don't leak a handle from _g_io_win32_get_module()
- Date: Mon, 29 Mar 2021 16:34:05 +0000 (UTC)
commit 03b574ae663153707a3e9c60ea75ce92a68446e6
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date: Thu Mar 25 15:20:27 2021 +0000
Don't leak a handle from _g_io_win32_get_module()
This call increments the DLL refcount by default and
needs a flag to avoid that.
gio/giomodule.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gio/giomodule.c b/gio/giomodule.c
index ca1daf2a8..a2909a8ef 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -1120,7 +1120,8 @@ void *
_g_io_win32_get_module (void)
{
if (!gio_dll)
- GetModuleHandleExA (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
+ GetModuleHandleExA (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(const char *) _g_io_win32_get_module,
&gio_dll);
return gio_dll;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]