mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
gio/module: ignore module leak
A module must exist forever after it is loaded. If it's not referenced anywhere, as with some gio tests, ASAN will report direct leaks. Silence those. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
3967d1da56
commit
d95cf75bf0
@ -579,7 +579,11 @@ g_io_modules_scan_all_in_directory_with_scope (const char *dirname,
|
|||||||
{
|
{
|
||||||
/* Try to load and init types */
|
/* Try to load and init types */
|
||||||
if (g_type_module_use (G_TYPE_MODULE (module)))
|
if (g_type_module_use (G_TYPE_MODULE (module)))
|
||||||
g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
|
{
|
||||||
|
g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
|
||||||
|
/* module must remain alive, because the type system keeps weak refs */
|
||||||
|
g_ignore_leak (module);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_printerr ("Failed to load module: %s\n", path);
|
g_printerr ("Failed to load module: %s\n", path);
|
||||||
|
Loading…
Reference in New Issue
Block a user