[glib: 1/2] gapplication: Add postconditions on calls to GApplication.dbus_register
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] gapplication: Add postconditions on calls to GApplication.dbus_register
- Date: Sat, 12 Dec 2020 09:01:01 +0000 (UTC)
commit 539621d2d3d058d20e11aedc09efc6bd0acdbe69
Author: Philip Withnall <withnall endlessm com>
Date: Fri Nov 17 11:02:35 2017 +0000
gapplication: Add postconditions on calls to GApplication.dbus_register
Try and catch programmer errors in third-party implementations of
`dbus_register()`.
Signed-off-by: Philip Withnall <withnall endlessm com>
Fixes: #1188
gio/gapplicationimpl-dbus.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gio/gapplicationimpl-dbus.c b/gio/gapplicationimpl-dbus.c
index 6f02788a2..263001b8e 100644
--- a/gio/gapplicationimpl-dbus.c
+++ b/gio/gapplicationimpl-dbus.c
@@ -371,6 +371,7 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
GApplicationFlags app_flags;
GVariant *reply;
guint32 rval;
+ GError *local_error = NULL;
if (org_gtk_Application == NULL)
{
@@ -430,8 +431,14 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
if (!app_class->dbus_register (impl->app,
impl->session_bus,
impl->object_path,
- error))
- return FALSE;
+ &local_error))
+ {
+ g_return_val_if_fail (local_error != NULL, FALSE);
+ g_propagate_error (error, g_steal_pointer (&local_error));
+ return FALSE;
+ }
+
+ g_return_val_if_fail (local_error == NULL, FALSE);
if (impl->bus_name == NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]