[gnome-settings-daemon/wip/smcv/smartcard-parent-struct] GsdSmartcardService: Use correct parent type for structs



commit 1b31868c23feb556b6b9abb9e922a77a24ac451b
Author: Simon McVittie <smcv debian org>
Date:   Mon Sep 16 08:40:42 2019 +0100

    GsdSmartcardService: Use correct parent type for structs
    
    GDBusObjectSkeleton objects are larger than GObject, so we need to
    allocate enough space. Otherwise, if we're lucky we'll get:
    
        Sep 13 11:09:32 espresso gsd-smartcard[12882]: specified class size for type 'GsdSmartcardService' is 
smaller than the parent type's 'GsdSmartcardServiceManagerSkeleton' class size
        Sep 13 11:09:32 espresso gsd-smartcard[12882]: g_type_add_interface_static: assertion 
'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
    
    and if we're unlucky we'll get object fields overwriting each other.
    
    Signed-off-by: Simon McVittie <smcv debian org>
    Fixes: 76b6b794 "smartcard: Use G_DECLARE_FINAL_TYPE for GsdSmartcardService"

 plugins/smartcard/gsd-smartcard-service.c | 2 +-
 plugins/smartcard/gsd-smartcard-service.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/smartcard/gsd-smartcard-service.c b/plugins/smartcard/gsd-smartcard-service.c
index 783624f6..4d529c30 100644
--- a/plugins/smartcard/gsd-smartcard-service.c
+++ b/plugins/smartcard/gsd-smartcard-service.c
@@ -32,7 +32,7 @@
 
 struct _GsdSmartcardService
 {
-        GObject                     parent;
+        GsdSmartcardServiceManagerSkeleton parent;
 
         GDBusConnection            *bus_connection;
         GDBusObjectManagerServer   *object_manager_server;
diff --git a/plugins/smartcard/gsd-smartcard-service.h b/plugins/smartcard/gsd-smartcard-service.h
index cf071fdc..11b3e222 100644
--- a/plugins/smartcard/gsd-smartcard-service.h
+++ b/plugins/smartcard/gsd-smartcard-service.h
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
 
 #define GSD_TYPE_SMARTCARD_SERVICE (gsd_smartcard_service_get_type ())
 
-G_DECLARE_FINAL_TYPE (GsdSmartcardService, gsd_smartcard_service, GSD, SMARTCARD_SERVICE, GObject)
+G_DECLARE_FINAL_TYPE (GsdSmartcardService, gsd_smartcard_service, GSD, SMARTCARD_SERVICE, 
GsdSmartcardServiceManagerSkeleton)
 
 void  gsd_smartcard_service_new_async (GsdSmartcardManager  *manager,
                                        GCancellable         *cancellable,


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