[gjs: 1/4] dbus-wrapper: Remove interface skeleton flush idle on dispose



commit 3f08d055738dc3d9252c541af3afe99ced606294
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Jul 23 17:37:59 2019 +0200

    dbus-wrapper: Remove interface skeleton flush idle on dispose
    
    Make sure that the idle we set on flush is removed when disposing the class

 libgjs-private/gjs-gdbus-wrapper.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/libgjs-private/gjs-gdbus-wrapper.c b/libgjs-private/gjs-gdbus-wrapper.c
index 216921c4..9394dbe3 100644
--- a/libgjs-private/gjs-gdbus-wrapper.c
+++ b/libgjs-private/gjs-gdbus-wrapper.c
@@ -164,6 +164,14 @@ gjs_dbus_implementation_init(GjsDBusImplementation *self) {
     priv->outstanding_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, 
(GDestroyNotify)g_variant_unref);
 }
 
+static void gjs_dbus_implementation_dispose(GObject* object) {
+    GjsDBusImplementation* self = GJS_DBUS_IMPLEMENTATION(object);
+
+    g_clear_handle_id(&self->priv->idle_id, g_source_remove);
+
+    G_OBJECT_CLASS(gjs_dbus_implementation_parent_class)->dispose(object);
+}
+
 static void
 gjs_dbus_implementation_finalize(GObject *object) {
     GjsDBusImplementation *self = GJS_DBUS_IMPLEMENTATION (object);
@@ -273,6 +281,7 @@ gjs_dbus_implementation_class_init(GjsDBusImplementationClass *klass) {
     GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
     GDBusInterfaceSkeletonClass *skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS(klass);
 
+    gobject_class->dispose = gjs_dbus_implementation_dispose;
     gobject_class->finalize = gjs_dbus_implementation_finalize;
     gobject_class->set_property = gjs_dbus_implementation_set_property;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]