mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-18 21:29:16 +02:00
Merge branch 'cancellable-cancel-null' into 'master'
gcancellable: add back lost NULL check in g_cancellable_cancel() Closes #1710 See merge request GNOME/glib!707
This commit is contained in:
commit
35db2ffe9c
@ -484,7 +484,7 @@ g_cancellable_cancel (GCancellable *cancellable)
|
|||||||
{
|
{
|
||||||
GCancellablePrivate *priv;
|
GCancellablePrivate *priv;
|
||||||
|
|
||||||
if (g_cancellable_is_cancelled (cancellable))
|
if (cancellable == NULL || g_cancellable_is_cancelled (cancellable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
priv = cancellable->priv;
|
priv = cancellable->priv;
|
||||||
|
@ -216,12 +216,19 @@ test_cancel_multiple_concurrent (void)
|
|||||||
g_main_loop_unref (loop);
|
g_main_loop_unref (loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_cancel_null (void)
|
||||||
|
{
|
||||||
|
g_cancellable_cancel (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
g_test_init (&argc, &argv, NULL);
|
g_test_init (&argc, &argv, NULL);
|
||||||
|
|
||||||
g_test_add_func ("/cancellable/multiple-concurrent", test_cancel_multiple_concurrent);
|
g_test_add_func ("/cancellable/multiple-concurrent", test_cancel_multiple_concurrent);
|
||||||
|
g_test_add_func ("/cancellable/null", test_cancel_null);
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user