Hello community,

here is the log from the commit of package dconf for openSUSE:Factory checked 
in at 2019-10-17 12:57:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/dconf (Old)
 and      /work/SRC/openSUSE:Factory/.dconf.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "dconf"

Thu Oct 17 12:57:08 2019 rev:49 rq:736500 version:0.34.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/dconf/dconf.changes      2019-05-03 
22:12:45.215547833 +0200
+++ /work/SRC/openSUSE:Factory/.dconf.new.2352/dconf.changes    2019-10-17 
12:57:09.857628241 +0200
@@ -1,0 +2,17 @@
+Thu Sep 12 14:28:34 CST 2019 - qk...@suse.com
+
+- Update to version 0.34.0:
+  + Increment version number following 0.34 release. 
+
+-------------------------------------------------------------------
+Fri Aug 30 14:52:11 CDT 2019 - mgo...@suse.com
+
+- Update to version 0.33.2:
+  + Drop references to GDBusConnection objects when D-Bus
+    connections are closed.
+- Changes from version 0.33.1:
+  + Factor out a common method to route completion of D-Bus
+    methods through.
+  + build: Use weak bindings in gvdb to fix linking with LLD.
+
+-------------------------------------------------------------------

Old:
----
  dconf-0.32.0.tar.xz

New:
----
  dconf-0.34.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dconf.spec ++++++
--- /var/tmp/diff_new_pack.Xo4iBo/_old  2019-10-17 12:57:10.233627289 +0200
+++ /var/tmp/diff_new_pack.Xo4iBo/_new  2019-10-17 12:57:10.233627289 +0200
@@ -17,13 +17,13 @@
 
 
 Name:           dconf
-Version:        0.32.0
+Version:        0.34.0
 Release:        0
 Summary:        Key-based configuration system
 License:        LGPL-2.1-or-later
 Group:          System/Libraries
 URL:            https://live.gnome.org/dconf
-Source0:        
https://download.gnome.org/sources/dconf/0.32/%{name}-%{version}.tar.xz
+Source0:        
https://download.gnome.org/sources/dconf/0.34/%{name}-%{version}.tar.xz
 Source99:       baselibs.conf
 # PATCH-FIX-UPSTREAM 0001-gvdb-Restore-permissions-on-changed-files.patch 
bsc#1025721 bsc#971074 bgo#758066 fezh...@suse.com -- Restore permissions on 
files changed by dconf update.
 Patch0:         0001-gvdb-Restore-permissions-on-changed-files.patch

++++++ dconf-0.32.0.tar.xz -> dconf-0.34.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/NEWS new/dconf-0.34.0/NEWS
--- old/dconf-0.32.0/NEWS       2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/NEWS       2019-09-10 00:56:47.000000000 +0200
@@ -1,3 +1,17 @@
+Changes in dconf 0.33.2
+=======================
+
+ - Drop references to GDBusConnection objects when D-Bus connections are closed
+   (Andre Magalhaes, #51)
+
+Changes in dconf 0.33.1
+=======================
+
+ - Factor out a common method to route completion of D-Bus methods through
+   (Cosimo Cecchi, #29)
+ - build: Use weak bindings in gvdb to fix linking with LLD
+   (Ting-Wei Lan, #28)
+
 Changes in dconf 0.32.0
 =======================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/engine/dconf-engine.h 
new/dconf-0.34.0/engine/dconf-engine.h
--- old/dconf-0.32.0/engine/dconf-engine.h      2019-03-11 19:15:41.000000000 
+0100
+++ new/dconf-0.34.0/engine/dconf-engine.h      2019-09-10 00:56:47.000000000 
+0200
@@ -67,6 +67,17 @@
                                                                          const 
GVariantType      *expected_type,
                                                                          
GError                 **error);
 
+/* Helper function used by the client library to handle bus disconnection */
+G_GNUC_INTERNAL
+void                    dconf_engine_dbus_handle_connection_closed      
(GDBusConnection         *connection,
+                                                                         
gboolean                 remote_peer_vanished,
+                                                                         
GError                  *error,
+                                                                         
GMutex                  *bus_lock,
+                                                                         
gboolean                *bus_is_error,
+                                                                         
gpointer                *bus_data,
+                                                                         
GCallback                bus_closed_callback,
+                                                                         
gpointer                 bus_closed_callback_user_data);
+
 /* Notifies that a change occured.
  *
  * The engine lock is never held when calling this function so it is
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gdbus/dconf-gdbus-common.c 
new/dconf-0.34.0/gdbus/dconf-gdbus-common.c
--- old/dconf-0.32.0/gdbus/dconf-gdbus-common.c 1970-01-01 01:00:00.000000000 
+0100
+++ new/dconf-0.34.0/gdbus/dconf-gdbus-common.c 2019-09-10 00:56:47.000000000 
+0200
@@ -0,0 +1,42 @@
+#include "../engine/dconf-engine.h"
+
+void
+dconf_engine_dbus_handle_connection_closed (GDBusConnection *connection,
+                                            gboolean         
remote_peer_vanished,
+                                            GError          *error,
+                                            GMutex          *bus_lock,
+                                            gboolean        *bus_is_error,
+                                            gpointer        *bus_data,
+                                            GCallback        
bus_closed_callback,
+                                            gpointer         
bus_closed_callback_user_data)
+{
+  g_return_if_fail (connection != NULL);
+  g_return_if_fail (bus_is_error != NULL);
+  g_return_if_fail (bus_data != NULL);
+
+  g_debug ("D-Bus connection closed, invalidating cache: %s",
+           error != NULL ? error->message :
+             (remote_peer_vanished == FALSE ? "Close requested" : "Unknown 
reason"));
+
+  g_mutex_lock (bus_lock);
+
+  if (bus_closed_callback)
+    g_signal_handlers_disconnect_by_func (connection,
+                                          bus_closed_callback,
+                                          bus_closed_callback_user_data);
+
+  if (*bus_is_error)
+    {
+      g_clear_error ((GError **) bus_data);
+      *bus_is_error = FALSE;
+    }
+  else
+    {
+      g_assert (connection == *bus_data);
+      *bus_data = NULL;
+    }
+
+  g_object_unref (connection);
+
+  g_mutex_unlock (bus_lock);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gdbus/dconf-gdbus-filter.c 
new/dconf-0.34.0/gdbus/dconf-gdbus-filter.c
--- old/dconf-0.32.0/gdbus/dconf-gdbus-filter.c 2019-03-11 19:15:41.000000000 
+0100
+++ new/dconf-0.34.0/gdbus/dconf-gdbus-filter.c 2019-09-10 00:56:47.000000000 
+0200
@@ -6,7 +6,7 @@
 typedef struct
 {
   gpointer data; /* either GDBusConnection or GError */
-  guint    is_error;
+  gboolean is_error;
   guint    waiting_for_serial;
   GQueue   queue;
 } ConnectionState;
@@ -156,6 +156,22 @@
   return message;
 }
 
+static void
+dconf_gdbus_bus_connection_closed (GDBusConnection *connection,
+                                   gboolean         remote_peer_vanished,
+                                   GError          *error,
+                                   gpointer         user_data)
+{
+  ConnectionState *state = user_data;
+
+  dconf_engine_dbus_handle_connection_closed (connection, 
remote_peer_vanished, error,
+                                              &dconf_gdbus_lock,
+                                              &state->is_error,
+                                              &state->data,
+                                              G_CALLBACK 
(dconf_gdbus_bus_connection_closed),
+                                              user_data);
+}
+
 static ConnectionState *
 dconf_gdbus_get_connection_state (GBusType   bus_type,
                                   GError   **error)
@@ -166,7 +182,7 @@
 
   state = &connections[bus_type];
 
-  if (g_once_init_enter (&state->data))
+  if (!state->data)
     {
       GDBusConnection *connection;
       GError *error = NULL;
@@ -180,6 +196,9 @@
 
       if (connection)
         {
+          g_signal_connect (connection, "closed",
+                            G_CALLBACK (dconf_gdbus_bus_connection_closed),
+                            state);
           g_dbus_connection_add_filter (connection, 
dconf_gdbus_filter_function, state, NULL);
           result = connection;
           state->is_error = FALSE;
@@ -190,11 +209,11 @@
           state->is_error = TRUE;
         }
 
-      g_once_init_leave (&state->data, result);
+      state->data = result;
     }
 
   if (!connection_state_ensure_success (state, error))
-    return FALSE;
+    return NULL;
 
   return state;
 }
@@ -213,62 +232,67 @@
   GDBusMessage *message;
   DConfGDBusCall *call;
   gboolean success;
+  volatile guint *serial_ptr;
+  guint my_serial;
+
+  /* Hold the lock to make sure nothing else updates state (e.g. invalidates
+   * connection) while we are processing here.
+   */
+  g_mutex_lock (&dconf_gdbus_lock);
 
   state = dconf_gdbus_get_connection_state (bus_type, error);
 
   if (state == NULL)
     {
       g_variant_unref (g_variant_ref_sink (parameters));
+
+      g_mutex_unlock (&dconf_gdbus_lock);
+
       return FALSE;
     }
 
   message = g_dbus_message_new_method_call (bus_name, object_path, 
interface_name, method_name);
   g_dbus_message_set_body (message, parameters);
 
-  g_mutex_lock (&dconf_gdbus_lock);
-  {
-    volatile guint *serial_ptr;
-    guint my_serial;
+  /* We need to set the serial in call->serial.  Sometimes we also
+   * need to set it in state->waiting_for_serial (in the case that no
+   * other items are queued yet).
+   *
+   * g_dbus_connection_send_message() only has one out_serial parameter
+   * so we can only set one of them atomically.  If needed, we elect
+   * to set the waiting_for_serial because that is the one that is
+   * accessed from the filter function without holding the lock.
+   *
+   * The serial number in the call structure is only accessed after the
+   * lock is acquired which allows us to take our time setting it (for
+   * as long as we're still holding the lock).
+   *
+   * In the case that waiting_for_serial should not be set we just use
+   * a local variable and use that to fill call->serial.
+   *
+   * Also: the queue itself isn't accessed until after the lock is
+   * taken, so we can delay adding the call to the queue until we know
+   * that the sending of the message was successful.
+   */
+
+  if (g_queue_is_empty (&state->queue))
+    serial_ptr = &state->waiting_for_serial;
+  else
+    serial_ptr = &my_serial;
 
-    /* We need to set the serial in call->serial.  Sometimes we also
-     * need to set it in state->waiting_for_serial (in the case that no
-     * other items are queued yet).
-     *
-     * g_dbus_connection_send_message() only has one out_serial parameter
-     * so we can only set one of them atomically.  If needed, we elect
-     * to set the waiting_for_serial because that is the one that is
-     * accessed from the filter function without holding the lock.
-     *
-     * The serial number in the call structure is only accessed after the
-     * lock is acquired which allows us to take our time setting it (for
-     * as long as we're still holding the lock).
-     *
-     * In the case that waiting_for_serial should not be set we just use
-     * a local variable and use that to fill call->serial.
-     *
-     * Also: the queue itself isn't accessed until after the lock is
-     * taken, so we can delay adding the call to the queue until we know
-     * that the sending of the message was successful.
-     */
+  success = g_dbus_connection_send_message (connection_state_get_connection 
(state), message,
+                                            G_DBUS_SEND_MESSAGE_FLAGS_NONE, 
serial_ptr, error);
 
-    if (g_queue_is_empty (&state->queue))
-      serial_ptr = &state->waiting_for_serial;
-    else
-      serial_ptr = &my_serial;
-
-    success = g_dbus_connection_send_message (connection_state_get_connection 
(state), message,
-                                              G_DBUS_SEND_MESSAGE_FLAGS_NONE, 
serial_ptr, error);
+  if (success)
+    {
+      call = g_slice_new (DConfGDBusCall);
 
-    if (success)
-      {
-        call = g_slice_new (DConfGDBusCall);
+      call->handle = handle;
+      call->serial = *serial_ptr;
 
-        call->handle = handle;
-        call->serial = *serial_ptr;
+      g_queue_push_tail (&state->queue, call);
+    }
 
-        g_queue_push_tail (&state->queue, call);
-      }
-  }
   g_mutex_unlock (&dconf_gdbus_lock);
 
   g_object_unref (message);
@@ -286,18 +310,35 @@
                                   const GVariantType  *reply_type,
                                   GError             **error)
 {
+  g_autoptr(GDBusConnection) connection = NULL;
   ConnectionState *state;
 
+  /* Hold the lock to make sure nothing else updates state (e.g. invalidates
+   * connection) while we are processing here.
+   */
+  g_mutex_lock (&dconf_gdbus_lock);
+
   state = dconf_gdbus_get_connection_state (bus_type, error);
 
   if (state == NULL)
     {
       g_variant_unref (g_variant_ref_sink (parameters));
 
+      g_mutex_unlock (&dconf_gdbus_lock);
+
       return NULL;
     }
 
-  return g_dbus_connection_call_sync (connection_state_get_connection (state),
+  /* Hold a ref to the connection to make sure the object is still
+   * valid even if we get a closed signal on it (in which case the
+   * actual call would fail but the object would still be alive)
+   * while processing here.
+   */
+  connection = g_object_ref (connection_state_get_connection (state));
+
+  g_mutex_unlock (&dconf_gdbus_lock);
+
+  return g_dbus_connection_call_sync (connection,
                                       bus_name, object_path, interface_name, 
method_name, parameters, reply_type,
                                       G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gdbus/dconf-gdbus-thread.c 
new/dconf-0.34.0/gdbus/dconf-gdbus-thread.c
--- old/dconf-0.32.0/gdbus/dconf-gdbus-thread.c 2019-03-11 19:15:41.000000000 
+0100
+++ new/dconf-0.34.0/gdbus/dconf-gdbus-thread.c 2019-09-10 00:56:47.000000000 
+0200
@@ -176,32 +176,46 @@
 static gboolean dconf_gdbus_get_bus_is_error[5];
 
 static GDBusConnection *
-dconf_gdbus_get_bus_common (GBusType       bus_type,
-                            const GError **error)
+dconf_gdbus_get_bus_common (GBusType   bus_type,
+                            GError   **error)
 {
   if (dconf_gdbus_get_bus_is_error[bus_type])
     {
       if (error)
-        *error = dconf_gdbus_get_bus_data[bus_type];
+        *error = g_error_copy (dconf_gdbus_get_bus_data[bus_type]);
 
       return NULL;
     }
 
-  return dconf_gdbus_get_bus_data[bus_type];
+  return g_object_ref (dconf_gdbus_get_bus_data[bus_type]);
+}
+
+static void
+dconf_gdbus_bus_connection_closed (GDBusConnection *connection,
+                                   gboolean         remote_peer_vanished,
+                                   GError          *error,
+                                   gpointer         user_data)
+{
+  GBusType bus_type = GPOINTER_TO_INT (user_data);
+
+  dconf_engine_dbus_handle_connection_closed (connection, 
remote_peer_vanished, error,
+                                              &dconf_gdbus_get_bus_lock,
+                                              
&dconf_gdbus_get_bus_is_error[bus_type],
+                                              
&dconf_gdbus_get_bus_data[bus_type],
+                                              G_CALLBACK 
(dconf_gdbus_bus_connection_closed),
+                                              user_data);
 }
 
 static GDBusConnection *
-dconf_gdbus_get_bus_in_worker (GBusType       bus_type,
-                               const GError **error)
+dconf_gdbus_get_bus_in_worker (GBusType   bus_type,
+                               GError   **error)
 {
+  GDBusConnection *connection;
   g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_gdbus_get_bus_data));
 
-  /* We're in the worker thread and only the worker thread can ever set
-   * this variable so there is no need to take a lock.
-   */
+  g_mutex_lock (&dconf_gdbus_get_bus_lock);
   if (dconf_gdbus_get_bus_data[bus_type] == NULL)
     {
-      GDBusConnection *connection;
       GError *error = NULL;
       gpointer result;
 
@@ -209,6 +223,9 @@
 
       if (connection)
         {
+          g_signal_connect (connection, "closed",
+                            G_CALLBACK (dconf_gdbus_bus_connection_closed),
+                            GINT_TO_POINTER (bus_type));
           g_dbus_connection_signal_subscribe (connection, NULL, 
"ca.desrt.dconf.Writer",
                                               NULL, NULL, NULL, 
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
                                               dconf_gdbus_signal_handler, 
GINT_TO_POINTER (bus_type), NULL);
@@ -231,13 +248,15 @@
        * flushed all outstanding writes.  The other CPU has to acquire
        * the lock so it cannot have done any out-of-order reads either.
        */
-      g_mutex_lock (&dconf_gdbus_get_bus_lock);
       dconf_gdbus_get_bus_data[bus_type] = result;
-      g_cond_broadcast (&dconf_gdbus_get_bus_cond);
-      g_mutex_unlock (&dconf_gdbus_get_bus_lock);
     }
 
-  return dconf_gdbus_get_bus_common (bus_type, error);
+  connection = dconf_gdbus_get_bus_common (bus_type, error);
+
+  g_cond_broadcast (&dconf_gdbus_get_bus_cond);
+  g_mutex_unlock (&dconf_gdbus_get_bus_lock);
+
+  return connection;
 }
 
 static void
@@ -260,8 +279,8 @@
 dconf_gdbus_method_call (gpointer user_data)
 {
   DConfGDBusCall *call = user_data;
-  GDBusConnection *connection;
-  const GError *error = NULL;
+  g_autoptr(GDBusConnection) connection = NULL;
+  g_autoptr(GError) error = NULL;
 
   connection = dconf_gdbus_get_bus_in_worker (call->bus_type, &error);
 
@@ -315,16 +334,19 @@
 dconf_gdbus_summon_bus (gpointer user_data)
 {
   GBusType bus_type = GPOINTER_TO_INT (user_data);
+  g_autoptr(GDBusConnection) connection = NULL;
 
-  dconf_gdbus_get_bus_in_worker (bus_type, NULL);
+  connection = dconf_gdbus_get_bus_in_worker (bus_type, NULL);
 
   return G_SOURCE_REMOVE;
 }
 
 static GDBusConnection *
-dconf_gdbus_get_bus_for_sync (GBusType       bus_type,
-                              const GError **error)
+dconf_gdbus_get_bus_for_sync (GBusType   bus_type,
+                              GError   **error)
 {
+  g_autoptr(GDBusConnection) connection = NULL;
+
   g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_gdbus_get_bus_data));
 
   /* I'm not 100% sure we have to lock as much as we do here, but let's
@@ -343,9 +365,10 @@
       while (dconf_gdbus_get_bus_data[bus_type] == NULL)
         g_cond_wait (&dconf_gdbus_get_bus_cond, &dconf_gdbus_get_bus_lock);
     }
+  connection = dconf_gdbus_get_bus_common (bus_type, error);
   g_mutex_unlock (&dconf_gdbus_get_bus_lock);
 
-  return dconf_gdbus_get_bus_common (bus_type, error);
+  return g_steal_pointer (&connection);
 }
 
 GVariant *
@@ -358,18 +381,14 @@
                                   const GVariantType  *reply_type,
                                   GError             **error)
 {
-  const GError *inner_error = NULL;
-  GDBusConnection *connection;
+  g_autoptr(GDBusConnection) connection = NULL;
 
-  connection = dconf_gdbus_get_bus_for_sync (bus_type, &inner_error);
+  connection = dconf_gdbus_get_bus_for_sync (bus_type, error);
 
   if (connection == NULL)
     {
       g_variant_unref (g_variant_ref_sink (parameters));
 
-      if (error)
-        *error = g_error_copy (inner_error);
-
       return NULL;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gdbus/meson.build 
new/dconf-0.34.0/gdbus/meson.build
--- old/dconf-0.32.0/gdbus/meson.build  2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/gdbus/meson.build  2019-09-10 00:56:47.000000000 +0200
@@ -1,6 +1,14 @@
+libdconf_gdbus_common_sources = files(
+  'dconf-gdbus-common.c',
+)
+
+libdconf_gdbus_thread_sources = libdconf_gdbus_common_sources + files(
+  'dconf-gdbus-thread.c',
+)
+
 libdconf_gdbus_thread = static_library(
   'dconf-gdbus-thread',
-  sources: 'dconf-gdbus-thread.c',
+  sources: libdconf_gdbus_thread_sources,
   include_directories: top_inc,
   dependencies: libdconf_engine_dep,
   c_args: dconf_c_args,
@@ -12,9 +20,13 @@
   link_with: libdconf_gdbus_thread,
 )
 
+libdconf_gdbus_filter_sources = libdconf_gdbus_common_sources + files(
+  'dconf-gdbus-filter.c',
+)
+
 libdconf_gdbus_filter = static_library(
   'dconf-gdbus-filter',
-  sources: 'dconf-gdbus-filter.c',
+  sources: libdconf_gdbus_filter_sources,
   include_directories: top_inc,
   dependencies: libdconf_engine_dep,
   c_args: dconf_c_args,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gvdb/gvdb-reader.c 
new/dconf-0.34.0/gvdb/gvdb-reader.c
--- old/dconf-0.32.0/gvdb/gvdb-reader.c 2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/gvdb/gvdb-reader.c 2019-09-10 00:56:47.000000000 +0200
@@ -332,7 +332,7 @@
 /**
  * gvdb_table_get_names:
  * @table: a #GvdbTable
- * @length: the number of items returned, or %NULL
+ * @length: (optional): the number of items returned, or %NULL
  *
  * Gets a list of all names contained in @table.
  *
@@ -344,11 +344,11 @@
  * above calls in the case of the corrupted file.  Note also that the
  * returned strings may not be utf8.
  *
- * Returns: a %NULL-terminated list of strings, of length @length
+ * Returns: (array length=length): a %NULL-terminated list of strings, of 
length @length
  **/
 gchar **
 gvdb_table_get_names (GvdbTable *table,
-                      gint      *length)
+                      gsize     *length)
 {
   gchar **names;
   gint n_names;
@@ -462,7 +462,7 @@
     {
       GPtrArray *fixed_names;
 
-      fixed_names = g_ptr_array_new ();
+      fixed_names = g_ptr_array_sized_new (n_names);
       for (i = 0; i < n_names; i++)
         if (names[i] != NULL)
           g_ptr_array_add (fixed_names, names[i]);
@@ -474,7 +474,10 @@
     }
 
   if (length)
-    *length = n_names;
+    {
+      G_STATIC_ASSERT (sizeof (*length) >= sizeof (n_names));
+      *length = n_names;
+    }
 
   return names;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gvdb/gvdb-reader.h 
new/dconf-0.34.0/gvdb/gvdb-reader.h
--- old/dconf-0.32.0/gvdb/gvdb-reader.h 2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/gvdb/gvdb-reader.h 2019-09-10 00:56:47.000000000 +0200
@@ -22,40 +22,55 @@
 
 #include <glib.h>
 
+/* We cannot enable the weak attribute unconditionally here because both
+ * gvdb/gvdb-reader.c and tests/dconf-mock-gvdb.c include this file. The
+ * intention of using weak symbols here is to allow the latter to override
+ * functions defined in the former, so functions in tests/dconf-mock-gvdb.c
+ * must have strong bindings. */
+#ifdef GVDB_USE_WEAK_SYMBOLS
+# ifdef __GNUC__
+#  define GVDB_GNUC_WEAK __attribute__((weak))
+# else
+#  define GVDB_GNUC_WEAK
+# endif
+#else
+# define GVDB_GNUC_WEAK
+#endif
+
 typedef struct _GvdbTable GvdbTable;
 
 G_BEGIN_DECLS
 
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 GvdbTable *             gvdb_table_new_from_bytes                       
(GBytes       *bytes,
                                                                          
gboolean      trusted,
                                                                          
GError      **error);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 GvdbTable *             gvdb_table_new                                  (const 
gchar  *filename,
                                                                          
gboolean      trusted,
                                                                          
GError      **error);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 void                    gvdb_table_free                                 
(GvdbTable    *table);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 gchar **                gvdb_table_get_names                            
(GvdbTable    *table,
-                                                                         gint  
       *length);
-G_GNUC_INTERNAL
+                                                                         gsize 
       *length);
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 gchar **                gvdb_table_list                                 
(GvdbTable    *table,
                                                                          const 
gchar  *key);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 GvdbTable *             gvdb_table_get_table                            
(GvdbTable    *table,
                                                                          const 
gchar  *key);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 GVariant *              gvdb_table_get_raw_value                        
(GvdbTable    *table,
                                                                          const 
gchar  *key);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 GVariant *              gvdb_table_get_value                            
(GvdbTable    *table,
                                                                          const 
gchar  *key);
 
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 gboolean                gvdb_table_has_value                            
(GvdbTable    *table,
                                                                          const 
gchar  *key);
-G_GNUC_INTERNAL
+G_GNUC_INTERNAL GVDB_GNUC_WEAK
 gboolean                gvdb_table_is_valid                             
(GvdbTable    *table);
 
 G_END_DECLS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/gvdb/meson.build 
new/dconf-0.34.0/gvdb/meson.build
--- old/dconf-0.32.0/gvdb/meson.build   2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/gvdb/meson.build   2019-09-10 00:56:47.000000000 +0200
@@ -10,6 +10,7 @@
 cflags = [
   '-DG_LOG_DOMAIN="gvdb (via dconf)"',
   '-DG_LOG_USE_STRUCTURED=1',
+  '-DGVDB_USE_WEAK_SYMBOLS',
 ]
 
 libgvdb = static_library(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/meson.build new/dconf-0.34.0/meson.build
--- old/dconf-0.32.0/meson.build        2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/meson.build        2019-09-10 00:56:47.000000000 +0200
@@ -1,6 +1,6 @@
 project(
   'dconf', ['c'],
-  version: '0.32.0',
+  version: '0.34.0',
   license: 'LGPL2.1+',
   meson_version: '>= 0.47.0',
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/service/dconf-gvdb-utils.c 
new/dconf-0.34.0/service/dconf-gvdb-utils.c
--- old/dconf-0.32.0/service/dconf-gvdb-utils.c 2019-03-11 19:15:41.000000000 
+0100
+++ new/dconf-0.34.0/service/dconf-gvdb-utils.c 2019-09-10 00:56:47.000000000 
+0200
@@ -102,8 +102,8 @@
   if (table != NULL)
     {
       gchar **names;
-      gint n_names;
-      gint i;
+      gsize n_names;
+      gsize i;
 
       names = gvdb_table_get_names (table, &n_names);
       for (i = 0; i < n_names; i++)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/service/dconf-writer.c 
new/dconf-0.34.0/service/dconf-writer.c
--- old/dconf-0.32.0/service/dconf-writer.c     2019-03-11 19:15:41.000000000 
+0100
+++ new/dconf-0.34.0/service/dconf-writer.c     2019-09-10 00:56:47.000000000 
+0200
@@ -252,6 +252,21 @@
   return DCONF_WRITER_GET_CLASS (writer)->end (writer);
 }
 
+static void
+dconf_writer_complete_invocation (DConfDBusWriter       *dbus_writer,
+                                  GDBusMethodInvocation *invocation,
+                                  GVariant              *result,
+                                  GError                *error)
+{
+  if (error)
+    {
+      g_dbus_method_invocation_return_gerror (invocation, error);
+      g_error_free (error);
+    }
+  else
+    g_dbus_method_invocation_return_value (invocation, result);
+}
+
 static gboolean
 dconf_writer_handle_init (DConfDBusWriter       *dbus_writer,
                           GDBusMethodInvocation *invocation)
@@ -264,15 +279,7 @@
   if (dconf_writer_begin (writer, &error))
     dconf_writer_commit (writer, &error);
 
-  if (error)
-    {
-      g_dbus_method_invocation_return_gerror (invocation, error);
-      g_error_free (error);
-    }
-
-  else
-    g_dbus_method_invocation_return_value (invocation, NULL);
-
+  dconf_writer_complete_invocation (dbus_writer, invocation, NULL, error);
   dconf_writer_end (writer);
 
   return TRUE;
@@ -286,7 +293,7 @@
   DConfWriter *writer = DCONF_WRITER (dbus_writer);
   DConfChangeset *changeset;
   GError *error = NULL;
-  GVariant *tmp, *args;
+  GVariant *tmp, *args, *result = NULL;
   gchar *tag;
 
   dconf_blame_record (invocation);
@@ -316,19 +323,13 @@
     }
 
 out:
-  dconf_changeset_unref (changeset);
-
-  if (error)
-    {
-      g_dbus_method_invocation_return_gerror (invocation, error);
-      g_error_free (error);
-    }
-
-  else
-    g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", 
tag));
+  if (!error)
+    result = g_variant_new ("(s)", tag);
 
+  dconf_changeset_unref (changeset);
   g_free (tag);
 
+  dconf_writer_complete_invocation (dbus_writer, invocation, result, error);
   dconf_writer_end (writer);
 
   return TRUE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/tests/dbus-leak.c 
new/dconf-0.34.0/tests/dbus-leak.c
--- old/dconf-0.32.0/tests/dbus-leak.c  1970-01-01 01:00:00.000000000 +0100
+++ new/dconf-0.34.0/tests/dbus-leak.c  2019-09-10 00:56:47.000000000 +0200
@@ -0,0 +1,45 @@
+#include "../engine/dconf-engine.h"
+
+static void
+test_engine_dbus_call (void)
+{
+  GError *error = NULL;
+  GVariant *reply;
+
+  /* Force a call to the engine to make sure at least one GDBusConnection
+   * is cached.
+   */
+  reply = dconf_engine_dbus_call_sync_func (G_BUS_TYPE_SESSION,
+                                            "org.freedesktop.DBus", "/", 
"org.freedesktop.DBus", "ListNames",
+                                            g_variant_new ("()"), 
G_VARIANT_TYPE ("(as)"), &error);
+  g_assert_no_error (error);
+  g_assert (reply != NULL);
+  g_assert (g_variant_is_of_type (reply, G_VARIANT_TYPE ("(as)")));
+  g_variant_unref (reply);
+}
+
+int
+main (int argc, char **argv)
+{
+  GTestDBus *test_bus;
+  int res;
+
+  g_test_init (&argc, &argv, NULL);
+
+  dconf_engine_dbus_init_for_testing ();
+
+  g_test_add_func (DBUS_BACKEND "/dbus/engine-dbus-call", 
test_engine_dbus_call);
+
+  test_bus = g_test_dbus_new (G_TEST_DBUS_NONE);
+
+  g_test_dbus_up (test_bus);
+
+  res = g_test_run ();
+
+  /* g_test_dbus_down will fail if GDBusConnection leaks */
+  g_test_dbus_down (test_bus);
+
+  g_object_unref (test_bus);
+
+  return res;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/tests/dconf-mock-gvdb.c 
new/dconf-0.34.0/tests/dconf-mock-gvdb.c
--- old/dconf-0.32.0/tests/dconf-mock-gvdb.c    2019-03-11 19:15:41.000000000 
+0100
+++ new/dconf-0.34.0/tests/dconf-mock-gvdb.c    2019-09-10 00:56:47.000000000 
+0200
@@ -170,7 +170,7 @@
 
 gchar **
 gvdb_table_get_names (GvdbTable *table,
-                      gint      *length)
+                      gsize     *length)
 {
   if (length)
     *length = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/tests/gvdb.c 
new/dconf-0.34.0/tests/gvdb.c
--- old/dconf-0.32.0/tests/gvdb.c       2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/tests/gvdb.c       2019-09-10 00:56:47.000000000 +0200
@@ -35,8 +35,8 @@
   GError *error = NULL;
   GvdbTable *table;
   gchar **names;
-  gint n_names;
-  gint i;
+  gsize n_names;
+  gsize i;
 
   table = gvdb_table_new (SRCDIR "/gvdbs/empty_gvdb", TRUE, &error);
   g_assert_no_error (error);
@@ -85,7 +85,7 @@
 {
   GVariant *value;
   gchar **list;
-  gint n_names;
+  gsize n_names;
   gboolean has;
 
   /* We could not normally expect these to be in a particular order but
@@ -221,7 +221,7 @@
   GvdbTable *table;
   GvdbTable *locks;
   gchar **names;
-  gint n_names;
+  gsize n_names;
   gboolean has;
 
   table = gvdb_table_new (SRCDIR "/gvdbs/nested_gvdb", TRUE, &error);
@@ -277,8 +277,8 @@
   };
   gint found_items;
   gchar **names;
-  gint n_names;
-  gint i;
+  gsize n_names;
+  gsize i;
 
   if (level > 100)
     return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/dconf-0.32.0/tests/meson.build 
new/dconf-0.34.0/tests/meson.build
--- old/dconf-0.32.0/tests/meson.build  2019-03-11 19:15:41.000000000 +0100
+++ new/dconf-0.34.0/tests/meson.build  2019-09-10 00:56:47.000000000 +0200
@@ -28,6 +28,8 @@
   ['gvdb', 'gvdb.c', '-DSRCDIR="@0@"'.format(test_dir), libgvdb_dep, []],
   ['gdbus-thread', 'dbus.c', '-DDBUS_BACKEND="/gdbus/thread"', 
libdconf_gdbus_thread_dep, []],
   ['gdbus-filter', 'dbus.c', '-DDBUS_BACKEND="/gdbus/filter"', 
libdconf_gdbus_filter_dep, []],
+  ['gdbus-thread-leak', 'dbus-leak.c', '-DDBUS_BACKEND="/gdbus/thread"', 
[libdconf_client_dep, libdconf_gdbus_thread_dep], []],
+  ['gdbus-filter-leak', 'dbus-leak.c', '-DDBUS_BACKEND="/gdbus/filter"', 
[libdconf_client_dep, libdconf_gdbus_filter_dep], []],
   ['engine', 'engine.c', '-DSRCDIR="@0@"'.format(test_dir), [dl_dep, 
libdconf_engine_test_dep, m_dep], libdconf_mock],
   ['client', 'client.c', '-DSRCDIR="@0@"'.format(test_dir), 
[libdconf_client_dep, libdconf_engine_dep], libdconf_mock],
   ['writer', 'writer.c', '-DSRCDIR="@0@"'.format(test_dir), [glib_dep, dl_dep, 
m_dep, libdconf_service_dep], [libdconf_mock]],


Reply via email to