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 710453 - libgee memory leak fixes
libgee memory leak fixes
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Meta Contacts
3.10.x
Other All
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-18 13:23 UTC by Philip Withnall
Modified: 2013-10-22 09:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libempathy-gtk: Fix several memory leaks from libgee (6.13 KB, patch)
2013-10-18 13:28 UTC, Philip Withnall
none Details | Review
libempathy: Fix several memory leaks from libgee (2.64 KB, patch)
2013-10-18 13:28 UTC, Philip Withnall
none Details | Review
libempathy-gtk: Fix several memory leaks from libgee (7.76 KB, patch)
2013-10-18 13:42 UTC, Philip Withnall
committed Details | Review
libempathy: Fix several memory leaks from libgee (2.64 KB, patch)
2013-10-18 13:42 UTC, Philip Withnall
committed Details | Review

Description Philip Withnall 2013-10-18 13:23:43 UTC
Patch coming up to fix a number of reference count leaks caused by incorrect use of libgee.
Comment 1 Philip Withnall 2013-10-18 13:28:51 UTC
Created attachment 257638 [details] [review]
libempathy-gtk: Fix several memory leaks from libgee

libgee’s GeeIterator returns a new reference from most of its methods,
especially gee_iterable_iterator() and gee_iterator_get(). Add corresponding
g_object_unref() calls.
Comment 2 Philip Withnall 2013-10-18 13:28:53 UTC
Created attachment 257639 [details] [review]
libempathy: Fix several memory leaks from libgee

See commit 039dc326208e02b687e93739434e27a867f4ffa7.
Comment 3 Philip Withnall 2013-10-18 13:32:25 UTC
Also available as a branch here: http://cgit.collabora.com/git/user/pwith/empathy.git/log/?h=710453-libgee-memory-leaks
Comment 4 Philip Withnall 2013-10-18 13:42:04 UTC
Created attachment 257640 [details] [review]
libempathy-gtk: Fix several memory leaks from libgee

libgee’s GeeIterator returns a new reference from most of its methods,
especially gee_iterable_iterator() and gee_iterator_get(). Add corresponding
g_object_unref() calls.
Comment 5 Philip Withnall 2013-10-18 13:42:07 UTC
Created attachment 257641 [details] [review]
libempathy: Fix several memory leaks from libgee

See commit 039dc326208e02b687e93739434e27a867f4ffa7.
Comment 6 Guillaume Desmottes 2013-10-22 08:23:48 UTC
Review of attachment 257640 [details] [review]:

Thanks for for this.

A small thing to check and it's good to go (3.10 and master).

::: libempathy-gtk/empathy-individual-menu.c
@@ +344,1 @@
+  number = folks_phone_field_details_get_normalised (details);

shouldn't you free 'number'at some point?

@@ +469,2 @@
       type = find_phone_type (details);
+      number = folks_phone_field_details_get_normalised (details);

... you free number after this call so either this one or the previous call is wrong.
Comment 7 Guillaume Desmottes 2013-10-22 08:27:08 UTC
Review of attachment 257641 [details] [review]:

++ 3.10 and master please.
Comment 8 Philip Withnall 2013-10-22 09:44:41 UTC
(In reply to comment #6)
> ::: libempathy-gtk/empathy-individual-menu.c
> @@ +344,1 @@
> +  number = folks_phone_field_details_get_normalised (details);
> 
> shouldn't you free 'number'at some point?

Whoops, yes. Fixed before merging.


Merged to master:

commit 35b9f0c90f66e81f5008ff866b5b4b4b47aae0a5
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Fri Oct 18 14:26:43 2013 +0100

    libempathy: Fix several memory leaks from libgee
    
    See commit 039dc326208e02b687e93739434e27a867f4ffa7.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710453

 libempathy/empathy-individual-manager.c | 9 ++++++---
 libempathy/empathy-utils.c              | 4 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

commit 5d618c618444363615431646471df7670ed76cf1
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Fri Oct 18 14:24:15 2013 +0100

    libempathy-gtk: Fix several memory leaks from libgee
    
    libgee’s GeeIterator returns a new reference from most of its methods,
    especially gee_iterable_iterator() and gee_iterator_get(). Add corresponding
    g_object_unref() calls.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710453

 libempathy-gtk/empathy-individual-menu.c         | 51 +++++++++++++++++++++++++++++++++---------------
 libempathy-gtk/empathy-individual-widget.c       |  4 +++-
 libempathy-gtk/empathy-roster-model-aggregator.c | 13 +++++++++---
 3 files changed, 48 insertions(+), 20 deletions(-)


and 3.10:

commit 9419a9b70f97e3617571ea3ce02138105117788a
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Fri Oct 18 14:26:43 2013 +0100

    libempathy: Fix several memory leaks from libgee
    
    See commit 039dc326208e02b687e93739434e27a867f4ffa7.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710453

 libempathy/empathy-individual-manager.c | 9 ++++++---
 libempathy/empathy-utils.c              | 4 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

commit c754b1deab91b48e6b203dd2c6f1293a124c66af
Author: Philip Withnall <philip.withnall@collabora.co.uk>
Date:   Fri Oct 18 14:24:15 2013 +0100

    libempathy-gtk: Fix several memory leaks from libgee
    
    libgee’s GeeIterator returns a new reference from most of its methods,
    especially gee_iterable_iterator() and gee_iterator_get(). Add corresponding
    g_object_unref() calls.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710453

 libempathy-gtk/empathy-individual-menu.c         | 51 +++++++++++++++++++++++++++++++++---------------
 libempathy-gtk/empathy-individual-widget.c       |  4 +++-
 libempathy-gtk/empathy-roster-model-aggregator.c | 13 +++++++++---
 3 files changed, 48 insertions(+), 20 deletions(-)