mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gthreadedsocketservice: Handle thread pool push failure
This was previously silently ignored, and would result in a leak. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
035c5d03f1
commit
2dac148299
@ -110,6 +110,7 @@ g_threaded_socket_service_incoming (GSocketService *service,
|
||||
{
|
||||
GThreadedSocketService *threaded;
|
||||
GThreadedSocketServiceData *data;
|
||||
GError *local_error = NULL;
|
||||
|
||||
threaded = G_THREADED_SOCKET_SERVICE (service);
|
||||
|
||||
@ -123,9 +124,13 @@ g_threaded_socket_service_incoming (GSocketService *service,
|
||||
g_socket_service_stop (service);
|
||||
G_UNLOCK (job_count);
|
||||
|
||||
g_thread_pool_push (threaded->priv->thread_pool, data, NULL);
|
||||
|
||||
if (!g_thread_pool_push (threaded->priv->thread_pool, data, &local_error))
|
||||
{
|
||||
g_warning ("Error handling incoming socket: %s", local_error->message);
|
||||
g_threaded_socket_service_data_free (data);
|
||||
}
|
||||
|
||||
g_clear_error (&local_error);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user