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 706126 - Some reference counting issues in gom-miner-main.c
Some reference counting issues in gom-miner-main.c
Status: RESOLVED FIXED
Product: gnome-online-miners
Classification: Applications
Component: general
3.9.x
Other All
: Normal normal
: ---
Assigned To: GNOME Online Miners maintainer(s)
GNOME Online Miners maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-08-16 12:07 UTC by Debarshi Ray
Modified: 2013-08-18 05:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
miner-main: Fix and simplify reference counting (1.31 KB, patch)
2013-08-16 12:08 UTC, Debarshi Ray
none Details | Review
miner-main: Fix and simplify reference counting (1.35 KB, patch)
2013-08-16 13:22 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2013-08-16 12:07:27 UTC
In gom-miner-main.c, I see that the invocation is ref'ed on each call to RefreshDB, but never unref'ed. However the miner is unref'ed on completion of RefreshDB, even though an extra reference was never added to it.

I think this is wrong.

I could be wrong, though. :-)
Comment 1 Debarshi Ray 2013-08-16 12:08:16 UTC
Created attachment 251827 [details] [review]
miner-main: Fix and simplify reference counting
Comment 2 Debarshi Ray 2013-08-16 12:15:04 UTC
Skimming through the GDBus sources, I think that the ref/unref on the invocation is not needed because it won't be unref'ed unless we call g_dbus_method_invocation_return_value or g_dbus_method_invocation_return_error.

Hence there is probably no need to add an extra reference to it in the first place.
Comment 3 Debarshi Ray 2013-08-16 13:22:53 UTC
Created attachment 251839 [details] [review]
miner-main: Fix and simplify reference counting
Comment 4 Cosimo Cecchi 2013-08-17 08:42:33 UTC
Review of attachment 251839 [details] [review]:

I think this is correct.
Comment 5 Debarshi Ray 2013-08-18 05:21:52 UTC
Thanks for the review.