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 662763 - Bad unref in grl-net
Bad unref in grl-net
Status: RESOLVED FIXED
Product: grilo
Classification: Other
Component: core
git master
Other Linux
: Normal normal
: ---
Assigned To: grilo-maint
grilo-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-26 13:04 UTC by Sam Thursfield
Modified: 2011-11-03 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
grl-net: Correctly unref operation async result (1.84 KB, patch)
2011-10-26 13:04 UTC, Sam Thursfield
reviewed Details | Review
Patch backported to 0.1.x branch (2.50 KB, patch)
2011-11-02 19:52 UTC, Simon Pena
none Details | Review

Description Sam Thursfield 2011-10-26 13:04:00 UTC
Hi

The GSimpleAsyncResult used in grl-net-wc is unreffed in its own callback. This is bad, because the g_simple_async_result_complete() function accesses the object after it runs the callback and does not hold its own reference.

Attached is a patch to unref correctly.
Comment 1 Sam Thursfield 2011-10-26 13:04:07 UTC
Created attachment 200020 [details] [review]
grl-net: Correctly unref operation async result

Correct behaviour is to unref the GSimpleAsyncResult object after the call to
g_simple_async_result_complete(). It cannot be done in the async result's callback.
Comment 2 Simon Pena 2011-10-27 08:02:11 UTC
Hi, thanks for the patch. Like the others, we'll be reviewing it as soon as possible.
Comment 3 Víctor Manuel Jáquez Leal 2011-10-27 09:13:32 UTC
Review of attachment 200020 [details] [review]:

Good catch. Thanks!

Perhaps we could simplify the flow is some places later.
Comment 4 Sam Thursfield 2011-10-31 18:48:49 UTC
I've committed this one (hope that's ok with you)
Comment 5 Simon Pena 2011-11-02 19:52:43 UTC
Created attachment 200536 [details] [review]
Patch backported to 0.1.x branch

I've updated this patch to apply it as well in 0.1.x branch.
Comment 6 Simon Pena 2011-11-03 16:57:53 UTC
Pushed in 0.1.x branch, thanks