[glib: 1/3] Revert "gio/module: fix leak when there is no cache"




commit 3967d1da56d677d2c1291851fb21d4ef9afa6799
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Tue Oct 18 10:52:00 2022 +0400

    Revert "gio/module: fix leak when there is no cache"
    
    This reverts commit ad0fd6c5d9da1b1c00fdbc0cb3d1a9829e99faeb.
    
    The type system actually keeps a weak reference on the module/plugin.
    g_type_module_unuse() documentation is explicit "Once a #GTypeModule is
    initialized, it must exist forever."
    
    Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>

 gio/giomodule.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/giomodule.c b/gio/giomodule.c
index aa16231561..d8ed9801e4 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -581,8 +581,10 @@ g_io_modules_scan_all_in_directory_with_scope (const char     *dirname,
              if (g_type_module_use (G_TYPE_MODULE (module)))
                g_type_module_unuse (G_TYPE_MODULE (module)); /* Unload */
              else
-                g_printerr ("Failed to load module: %s\n", path);
-              g_object_unref (module);
+               {
+                 g_printerr ("Failed to load module: %s\n", path);
+                 g_object_unref (module);
+               }
            }
 
          g_free (path);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]