After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694390 - Assertion when calling grl_registry_unload_plugin() twice
Assertion when calling grl_registry_unload_plugin() twice
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
0.2.x
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-21 21:55 UTC by Mike Ruprecht
Modified: 2013-02-22 16:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix double-free protection assert when unloading a plugin twice (1.01 KB, patch)
2013-02-21 21:55 UTC, Mike Ruprecht
committed Details | Review

Description Mike Ruprecht 2013-02-21 21:55:36 UTC
Created attachment 237113 [details] [review]
Fix double-free protection assert when unloading a  plugin twice

When calling grl_registry_unload_plugin() twice, g_module_close() throws the following exception on the second call:

GModule-CRITICAL **: g_module_close: assertion `module->ref_count > 0' failed

Attached is a patch to prevent this by unsetting the plugin's module member just after g_module_close() is called on it.
Comment 1 Juan A. Suarez Romero 2013-02-22 16:37:39 UTC
commit 1c2a33adb18d25b9214c3a9859e72bf3bc01af0d
Author: Mike Ruprecht <mike.ruprecht@collabora.co.uk>
Date:   Thu Feb 21 15:39:28 2013 -0600

    core: Fix double-free protection assert when unloading a plugin twice
    
    When calling g_module_close() twice on the same module, it throws a
    g_return_if_fail() assertion stating ref_count > 0 fails. It's
    effectively like g_object_unref().
    
    This patch prevents g_module_close() being called twice on the same
    module by unsetting it from the plugin instance when closing it
    in grl_registry_unload_plugin().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694390

 src/grl-registry.c |    1 +
 1 file changed, 1 insertion(+)