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 727551 - Check use_count of GApplication in g_application_release()
Check use_count of GApplication in g_application_release()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gapplication
2.36.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-04-03 16:17 UTC by Marek Kašík
Modified: 2014-04-04 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't decrease use_count below 0 (757 bytes, patch)
2014-04-03 16:17 UTC, Marek Kašík
committed Details | Review

Description Marek Kašík 2014-04-03 16:17:57 UTC
Created attachment 273538 [details] [review]
Don't decrease use_count below 0

Since GApplication requires g_application_release() calls to be paired with calls of g_application_hold() it would be convenient to have an assert in g_application_release() which checks that use_count is higher than 0 before decreasing it. (see https://bugzilla.gnome.org/show_bug.cgi?id=727549 for additional info which led me to filing this bug)

Attached patch adds such an assert.

Regards

Marek
Comment 1 Allison Karlitskaya (desrt) 2014-04-04 13:37:55 UTC
Review of attachment 273538 [details] [review]:

Thanks!
Comment 2 Marek Kašík 2014-04-04 14:06:07 UTC
Comment on attachment 273538 [details] [review]
Don't decrease use_count below 0

(In reply to comment #1)
> Review of attachment 273538 [details] [review]:
> 
> Thanks!

Thank you for the review. I've pushed the patch to master, do you want me to push it also to a stable branch?

Marek
Comment 3 Allison Karlitskaya (desrt) 2014-04-04 14:14:50 UTC
It can't hurt -- go ahead.
Comment 4 Marek Kašík 2014-04-04 14:24:11 UTC
Thanks, I've pushed it to glib-2-40 and glib-2-38.