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 308953 - possible leaks of cairo contexts
possible leaks of cairo contexts
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-06-24 18:12 UTC by Kjartan Maraas
Modified: 2005-06-28 09:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
possible patch (5.33 KB, patch)
2005-06-24 18:52 UTC, Kjartan Maraas
none Details | Review
proposed patch (1.33 KB, patch)
2005-06-27 07:30 UTC, Kjartan Maraas
none Details | Review

Description Kjartan Maraas 2005-06-24 18:12:45 UTC
These are from a cursory manual inspection as I wasn't sure how to excercise
these parts of the code off hand.
Comment 1 Kjartan Maraas 2005-06-24 18:52:22 UTC
Created attachment 48289 [details] [review]
possible patch
Comment 2 Owen Taylor 2005-06-24 20:04:28 UTC
gdkpango.c changes are wrong  - the context is freed later.

gtkvruler.c change looks right, but see
also the pango layout that is being leaked and same code in gtkhruler.c.
(A goto to a label at the end of the function would be clearer than
duplicating the cleanup code)

The rest of the stuff isn't related to cairo contexts ... was it meant
to be in this bug report?
Comment 3 Kjartan Maraas 2005-06-26 23:13:26 UTC
I forgot I had some unrelated changes locally. I'll file a separate report for
those. Will take a stab at updating according to your comments.
Comment 4 Kjartan Maraas 2005-06-27 07:30:51 UTC
Created attachment 48400 [details] [review]
proposed patch

Does this look ok? I wasn't sure if the out: label should be before or after
the cairo_fill() call, but I guess after will give the same effect as now only
without leaking stuff.
Comment 5 Matthias Clasen 2005-06-27 14:32:10 UTC
Looks correct to me, please commit.
Comment 6 Kjartan Maraas 2005-06-27 14:39:11 UTC
Commited.
Comment 7 Owen Taylor 2005-06-27 15:13:58 UTC
Just to mention in case it wasn't a typo: goto statements should
be indented normally, not "outdented" to the left margin.

2005-06-27  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtk[hv]ruler.c (gtk_[hv]ruler_draw_ticks):
        Fix indentation.
Comment 8 Kjartan Maraas 2005-06-28 09:45:35 UTC
thanks for catching that, just a small braino...