mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
gdbus: Don't use g_assert_no_error() GDBusObjectManagerServer
There are real world cases where emitting signals can fail, such as if the DBus connection closes. Asserting and aborting the process in these cases is just plain lazy. Ignore the errors when the connection is closed, and turn the others into warnings. https://bugzilla.gnome.org/show_bug.cgi?id=753278
This commit is contained in:
parent
46cf19c447
commit
b3fcb1442e
@ -30,6 +30,8 @@
|
||||
#include "gdbusmethodinvocation.h"
|
||||
#include "gdbuserror.h"
|
||||
|
||||
#include "gioerror.h"
|
||||
|
||||
#include "glibintl.h"
|
||||
|
||||
/**
|
||||
@ -927,7 +929,11 @@ g_dbus_object_manager_server_emit_interfaces_added (GDBusObjectManagerServer *ma
|
||||
object_path,
|
||||
&array_builder),
|
||||
&error);
|
||||
g_assert_no_error (error);
|
||||
if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
|
||||
{
|
||||
g_warning ("Couldn't emit InterfacesAdded signal: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
out:
|
||||
;
|
||||
}
|
||||
@ -960,7 +966,11 @@ g_dbus_object_manager_server_emit_interfaces_removed (GDBusObjectManagerServer *
|
||||
object_path,
|
||||
&array_builder),
|
||||
&error);
|
||||
g_assert_no_error (error);
|
||||
if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
|
||||
{
|
||||
g_warning ("Couldn't emit InterfacesRemoved signal: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
out:
|
||||
;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user