mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 12:12:10 +01: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:
parent
fc597fa5f9
commit
99b580a0b2
@ -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_DEFINE_TYPE_WITH_CODE (GDBusServer, g_dbus_server, G_TYPE_OBJECT,
|
||||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init))
|
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
|
static void
|
||||||
g_dbus_server_finalize (GObject *object)
|
g_dbus_server_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@ -270,6 +281,7 @@ g_dbus_server_class_init (GDBusServerClass *klass)
|
|||||||
{
|
{
|
||||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
|
gobject_class->dispose = g_dbus_server_dispose;
|
||||||
gobject_class->finalize = g_dbus_server_finalize;
|
gobject_class->finalize = g_dbus_server_finalize;
|
||||||
gobject_class->set_property = g_dbus_server_set_property;
|
gobject_class->set_property = g_dbus_server_set_property;
|
||||||
gobject_class->get_property = g_dbus_server_get_property;
|
gobject_class->get_property = g_dbus_server_get_property;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user