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
#include "gdbusmethodinvocation.h"
#include "gdbuserror.h"
+#include "gioerror.h"
+
#include "glibintl.h"
/**
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:
;
}
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:
;
}