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 740942 - core: Fix excessive ref'ing when registering new keys
core: Fix excessive ref'ing when registering new keys
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
unspecified
Other All
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2014-12-01 00:04 UTC by Bastien Nocera
Modified: 2014-12-02 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: Fix excessive ref'ing when registering new keys (1.48 KB, patch)
2014-12-01 00:04 UTC, Bastien Nocera
none Details | Review
core: Fix excessive ref'ing when registering new keys (1.84 KB, patch)
2014-12-01 15:12 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2014-12-01 00:04:39 UTC
.
Comment 1 Bastien Nocera 2014-12-01 00:04:53 UTC
Created attachment 291851 [details] [review]
core: Fix excessive ref'ing when registering new keys

When registering new metadata keys, there's no need to take a new
reference to the GParamSpec passed, as the usual construct is to
call g_param_spec_new_... in the call to
grl_registry_register_metadata_key(), leaking the original reference
to the GParamSpec when grilo it de-inited.
Comment 2 Bastien Nocera 2014-12-01 00:06:02 UTC
Half the plugins do it that way, half the plugins do it the other way.

So either we choose to take ownership, or not. Either way, plugins will need to be fixed, just let me know which way it should go (I prefer this way...).
Comment 3 Bastien Nocera 2014-12-01 15:12:01 UTC
Created attachment 291916 [details] [review]
core: Fix excessive ref'ing when registering new keys

When registering new metadata keys, there's no need to take a new
reference to the GParamSpec passed, as the usual construct is to
call g_param_spec_new_... in the call to
grl_registry_register_metadata_key(), leaking the original reference
to the GParamSpec when grilo it de-inited.
Comment 4 Juan A. Suarez Romero 2014-12-02 10:09:12 UTC
(In reply to comment #2)
> Half the plugins do it that way, half the plugins do it the other way.
> 
> So either we choose to take ownership, or not. Either way, plugins will need to
> be fixed, just let me know which way it should go (I prefer this way...).

Yeah, I prefer this way too. Let's transfer the full key to core.
Comment 5 Juan A. Suarez Romero 2014-12-02 10:09:30 UTC
Review of attachment 291916 [details] [review]:

LGTM
Comment 6 Bastien Nocera 2014-12-02 10:14:26 UTC
Comment on attachment 291916 [details] [review]
core: Fix excessive ref'ing when registering new keys

Attachment 291916 [details] pushed as d3a2c27 - core: Fix excessive ref'ing when registering new keys
Comment 7 Bastien Nocera 2014-12-02 10:22:29 UTC
The plugins have been fixed now.