mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 02:06:18 +01:00
gthreadedsocketservice: Abstract out a free function
This introduces no functional changes. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
ec569ff2e2
commit
63823ae628
@ -75,6 +75,14 @@ typedef struct
|
|||||||
GObject *source_object;
|
GObject *source_object;
|
||||||
} GThreadedSocketServiceData;
|
} GThreadedSocketServiceData;
|
||||||
|
|
||||||
|
static void
|
||||||
|
g_threaded_socket_service_data_free (GThreadedSocketServiceData *data)
|
||||||
|
{
|
||||||
|
g_clear_object (&data->connection);
|
||||||
|
g_clear_object (&data->source_object);
|
||||||
|
g_slice_free (GThreadedSocketServiceData, data);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
g_threaded_socket_service_func (gpointer _data,
|
g_threaded_socket_service_func (gpointer _data,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@ -86,17 +94,12 @@ g_threaded_socket_service_func (gpointer _data,
|
|||||||
g_signal_emit (threaded, g_threaded_socket_service_run_signal,
|
g_signal_emit (threaded, g_threaded_socket_service_run_signal,
|
||||||
0, data->connection, data->source_object, &result);
|
0, data->connection, data->source_object, &result);
|
||||||
|
|
||||||
g_object_unref (data->connection);
|
|
||||||
if (data->source_object)
|
|
||||||
g_object_unref (data->source_object);
|
|
||||||
g_slice_free (GThreadedSocketServiceData, data);
|
|
||||||
|
|
||||||
G_LOCK (job_count);
|
G_LOCK (job_count);
|
||||||
if (threaded->priv->job_count-- == threaded->priv->max_threads)
|
if (threaded->priv->job_count-- == threaded->priv->max_threads)
|
||||||
g_socket_service_start (G_SOCKET_SERVICE (threaded));
|
g_socket_service_start (G_SOCKET_SERVICE (threaded));
|
||||||
G_UNLOCK (job_count);
|
G_UNLOCK (job_count);
|
||||||
|
|
||||||
g_object_unref (threaded);
|
g_threaded_socket_service_data_free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user