[gtk] Try again to fix profiler setup



commit 599806ca82b7b37b9efbbfd4f6e0643d1bbd48fa
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue May 14 20:09:44 2019 +0000

    Try again to fix profiler setup
    
    We were trying to store the profiler_id
    in a struct that does not exist at the time.
    Store it somewhere else.

 gtk/gtkapplication.c        | 10 +++++-----
 gtk/gtkapplicationprivate.h |  1 -
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 69e8e3b85c..9b992f686d 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -168,6 +168,7 @@ typedef struct
   GtkActionMuxer  *muxer;
   GtkBuilder      *menus_builder;
   gchar           *help_overlay_path;
+  guint            profiler_id;
 } GtkApplicationPrivate;
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkApplication, gtk_application, G_TYPE_APPLICATION)
@@ -689,8 +690,7 @@ gtk_application_dbus_register (GApplication     *application,
                                const char       *obect_path,
                                GError          **error)
 {
-  GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
-  GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) priv->impl;
+  GtkApplicationPrivate *priv = gtk_application_get_instance_private (GTK_APPLICATION (application));
   GDBusInterfaceVTable vtable = {
     sysprof_profiler_method_call,
     NULL,
@@ -710,7 +710,7 @@ gtk_application_dbus_register (GApplication     *application,
       g_dbus_node_info_unref (info);
     }
 
-  dbus->profiler_id = g_dbus_connection_register_object (connection,
+  priv->profiler_id = g_dbus_connection_register_object (connection,
                                                          "/org/gtk/Profiler",
                                                          org_gnome_Sysprof3_Profiler,
                                                          &vtable,
@@ -726,9 +726,9 @@ gtk_application_dbus_unregister (GApplication     *application,
                                  GDBusConnection  *connection,
                                  const char       *obect_path)
 {
-  GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) application;
+  GtkApplicationPrivate *priv = gtk_application_get_instance_private (GTK_APPLICATION (application));
 
-  g_dbus_connection_unregister_object (connection, dbus->profiler_id);
+  g_dbus_connection_unregister_object (connection, priv->profiler_id);
 }
 
 #else
diff --git a/gtk/gtkapplicationprivate.h b/gtk/gtkapplicationprivate.h
index f167c74362..24ef7c4a40 100644
--- a/gtk/gtkapplicationprivate.h
+++ b/gtk/gtkapplicationprivate.h
@@ -127,7 +127,6 @@ typedef struct
 
   gchar           *menubar_path;
   guint            menubar_id;
-  guint            profiler_id;
 
   /* Session management... */
   GDBusProxy      *sm_proxy;


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