mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-19 23:28:54 +02:00
gdbus: Stop server on dispose
This is not going to have much any effect currently since stop() just disconnects a signal handler (that is going to be disconnected in finalize anyway) and stops the socket service (that is going to be destroyed in finalize), but it makes sense to do here for robustness.
This commit is contained in:
@@ -161,6 +161,17 @@ static void initable_iface_init (GInitableIface *initable_iface);
|
||||
G_DEFINE_TYPE_WITH_CODE (GDBusServer, g_dbus_server, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init))
|
||||
|
||||
static void
|
||||
g_dbus_server_dispose (GObject *object)
|
||||
{
|
||||
GDBusServer *server = G_DBUS_SERVER (object);
|
||||
|
||||
if (server->active)
|
||||
g_dbus_server_stop (server);
|
||||
|
||||
G_OBJECT_CLASS (g_dbus_server_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
g_dbus_server_finalize (GObject *object)
|
||||
{
|
||||
@@ -270,6 +281,7 @@ g_dbus_server_class_init (GDBusServerClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
gobject_class->dispose = g_dbus_server_dispose;
|
||||
gobject_class->finalize = g_dbus_server_finalize;
|
||||
gobject_class->set_property = g_dbus_server_set_property;
|
||||
gobject_class->get_property = g_dbus_server_get_property;
|
||||
|
Reference in New Issue
Block a user