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 773954 - gtkstylecontext: Clarify memory allocation behaviour of getters
gtkstylecontext: Clarify memory allocation behaviour of getters
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Documentation
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-11-04 20:17 UTC by Philip Withnall
Modified: 2016-11-05 00:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkstylecontext: Clarify memory allocation behaviour of getters (1.50 KB, patch)
2016-11-04 20:17 UTC, Philip Withnall
none Details | Review
gtkstylecontext: Clarify memory allocation behaviour of getters (1.80 KB, patch)
2016-11-04 20:38 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2016-11-04 20:17:21 UTC
Trivial patch attached.
Comment 1 Philip Withnall 2016-11-04 20:17:24 UTC
Created attachment 339138 [details] [review]
gtkstylecontext: Clarify memory allocation behaviour of getters

It wasn’t clear that gtk_style_context_get[_valist]() behave like
g_object_get() — i.e. pointer-based types are returned newly-allocated.
Clarify that.
Comment 2 Benjamin Otte (Company) 2016-11-04 20:21:28 UTC
Shouldn't the docs say that the behavior is like g_object_get()?
We're using GValues after all, so it should in fact be exactly like g_object_get().

Your current patch reads to me a bit like it's trying to confuse people with that "in general" part.
Comment 3 Philip Withnall 2016-11-04 20:36:11 UTC
(In reply to Benjamin Otte (Company) from comment #2)
> Shouldn't the docs say that the behavior is like g_object_get()?
> We're using GValues after all, so it should in fact be exactly like
> g_object_get().
> 
> Your current patch reads to me a bit like it's trying to confuse people with
> that "in general" part.

The text in this patch is copied verbatim from the g_object_get() docs; the ‘in general’ part is, I guess, supposed to distinguish between integer/boolean/etc. values (which are not allocated) and pointer ones (which are).

I can update the patch to point to the g_object_get() docs instead.
Comment 4 Philip Withnall 2016-11-04 20:38:33 UTC
Created attachment 339139 [details] [review]
gtkstylecontext: Clarify memory allocation behaviour of getters

It wasn’t clear that gtk_style_context_get[_valist]() behave like
g_object_get() — i.e. pointer-based types are returned newly-allocated.
Clarify that.
Comment 5 Benjamin Otte (Company) 2016-11-04 21:42:49 UTC
Comment on attachment 339139 [details] [review]
gtkstylecontext: Clarify memory allocation behaviour of getters

I like formulation a lot more.
Comment 6 Philip Withnall 2016-11-05 00:26:54 UTC
Comment on attachment 339139 [details] [review]
gtkstylecontext: Clarify memory allocation behaviour of getters

commit 1dbdbecd39356a6ca4d0bb06a222d3229e055b3b
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Fri Nov 4 20:16:06 2016 +0000

    gtkstylecontext: Clarify memory allocation behaviour of getters
    
    It wasn’t clear that gtk_style_context_get[_valist]() behave like
    g_object_get() — i.e. pointer-based types are returned newly-allocated.
    Clarify that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773954