mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-02 02:40:07 +02:00
GAsyncQueue: assert non-null data in push_sorted()
While working on https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4648 I realized there is no assertion checking the data argument in either g_async_queue_push_sorted() or g_async_queue_push_sorted_unlocked(). All the other push functions assert that data is not null, and the argument is even marked as not nullable in g_async_queue_push_sorted(), so this is clearly an oversight. This patch adds the assert in the _unlocked() version, so that it applies to both. I have consciously separated this change from the other merge request, since that one only makes documentation changes, whereas adding an assert is a subtle change in behavior that could potentially show as a regression in buggy applications.
This commit is contained in:
parent
7b996a6ce5
commit
8dc4df894e
@ -347,6 +347,7 @@ g_async_queue_push_sorted_unlocked (GAsyncQueue *queue,
|
||||
SortData sd;
|
||||
|
||||
g_return_if_fail (queue != NULL);
|
||||
g_return_if_fail (data != NULL);
|
||||
|
||||
sd.func = func;
|
||||
sd.user_data = user_data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user