mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-31 06:13:29 +02:00
Use g_cancellable_connect/disconnect
Use the new cancellable helper functions to avoid races. (#572844)
This commit is contained in:
@@ -123,8 +123,8 @@ fd_source_finalize (GSource *source)
|
|||||||
FDSource *fd_source = (FDSource *)source;
|
FDSource *fd_source = (FDSource *)source;
|
||||||
|
|
||||||
if (fd_source->cancelled_tag)
|
if (fd_source->cancelled_tag)
|
||||||
g_signal_handler_disconnect (fd_source->cancellable,
|
g_cancellable_disconnect (fd_source->cancellable,
|
||||||
fd_source->cancelled_tag);
|
fd_source->cancelled_tag);
|
||||||
|
|
||||||
if (fd_source->cancellable)
|
if (fd_source->cancellable)
|
||||||
g_object_unref (fd_source->cancellable);
|
g_object_unref (fd_source->cancellable);
|
||||||
@@ -166,10 +166,9 @@ _g_fd_source_new (int fd,
|
|||||||
|
|
||||||
if (cancellable)
|
if (cancellable)
|
||||||
fd_source->cancelled_tag =
|
fd_source->cancelled_tag =
|
||||||
g_signal_connect_data (cancellable, "cancelled",
|
g_cancellable_connect (cancellable,
|
||||||
(GCallback)fd_source_cancelled_cb,
|
(GCallback)fd_source_cancelled_cb,
|
||||||
NULL, NULL,
|
NULL, NULL);
|
||||||
0);
|
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user