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 632294 - g_queue_remove() should return a boolean
g_queue_remove() should return a boolean
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.27.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-10-16 11:55 UTC by Matthew Barnes
Modified: 2011-06-04 02:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (2.60 KB, patch)
2010-10-16 11:55 UTC, Matthew Barnes
committed Details | Review
Have g_queue_remove() return a boolean (2.65 KB, patch)
2011-06-04 02:04 UTC, Matthias Clasen
committed Details | Review

Description Matthew Barnes 2010-10-16 11:55:45 UTC
Created attachment 172488 [details] [review]
Proposed patch

g_queue_remove() should return a boolean so callers can verify that an element was found and removed, as in the following example:

    if (g_queue_remove (queue, referenced_object))
        g_object_unref (referenced_object);

Similarly, g_queue_remove_all() should return the number of elements found and removed.
Comment 1 Matthias Clasen 2011-06-04 02:04:40 UTC
The following fix has been pushed:
f065d7d Have g_queue_remove() return a boolean
Comment 2 Matthias Clasen 2011-06-04 02:04:44 UTC
Created attachment 189195 [details] [review]
Have g_queue_remove() return a boolean

g_queue_remove() should return a boolean so callers can verify that an
element was found and removed, as in the following example:

    if (g_queue_remove (queue, referenced_object))
        g_object_unref (referenced_object);

Similarly, g_queue_remove_all() should return the number of elements
found and removed.