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 796139 - Add g_autoptr() support for GParamSpec
Add g_autoptr() support for GParamSpec
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gobject
2.56.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-05-15 14:08 UTC by Philip Withnall
Modified: 2018-05-15 16:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gobject: Add g_autoptr() support for GParamSpec (1.31 KB, patch)
2018-05-15 14:34 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2018-05-15 14:08:58 UTC
Support g_autoptr(GParamSpec).
Comment 1 Philip Withnall 2018-05-15 14:34:20 UTC
Created attachment 372072 [details] [review]
gobject: Add g_autoptr() support for GParamSpec

Do not add support for its subtypes, since all their constructors return
GParamSpec*, and g_param_spec_unref() takes a GParamSpec* rather than a
gpointer — adding G_DEFINE_AUTOPTR_CLEANUP_FUNC() for subtypes of
GParamSpec results in compiler warnings about mismatched parameter
types (GParamSpecBoolean* vs GParamSpec*, for example).

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Emmanuele Bassi (:ebassi) 2018-05-15 15:48:18 UTC
Review of attachment 372072 [details] [review]:

Sure, even though holding on to GParamSpecs this way is kind of weird.
Comment 3 Philip Withnall 2018-05-15 16:54:16 UTC
Thanks. It is needed for my evil plan. (https://github.com/endlessm/mogwai/blob/master/libmogwai-schedule/tests/signal-logger.h)

Attachment 372072 [details] pushed as cdfc79a - gobject: Add g_autoptr() support for GParamSpec