Commit 99b580a0 authored by Michael Catanzaro's avatar Michael Catanzaro

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.
parent fc597fa5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment