|
|
ab7d06 |
From 56c5b0af36f7f0bcd73732cf26833a24cf4017ba Mon Sep 17 00:00:00 2001
|
|
|
ab7d06 |
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
|
|
|
ab7d06 |
Date: Fri, 9 Oct 2015 20:31:29 +0200
|
|
|
ab7d06 |
Subject: [PATCH 1/2] macros: allow NULL pointer in nm_clear_g_signal_handler()
|
|
|
ab7d06 |
|
|
|
ab7d06 |
It does not make sense to issue an error. This should be a helper function.
|
|
|
ab7d06 |
"NetworkManager[18341]: nm_clear_g_signal_handler: assertion 'G_IS_OBJECT (self)' failed"
|
|
|
ab7d06 |
error started since commit e6d7fee5a617632acae02e12b1ec6156842df788 due to that.
|
|
|
ab7d06 |
|
|
|
ab7d06 |
(cherry picked from commit c33416178f88353b2f424a18c576de09b6ae3215)
|
|
|
ab7d06 |
(cherry picked from commit 23313d711ff7a328e96d1bc2da084bcb6266b3f0)
|
|
|
ab7d06 |
---
|
|
|
ab7d06 |
include/nm-macros-internal.h | 3 ++-
|
|
|
ab7d06 |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
ab7d06 |
|
|
|
ab7d06 |
diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h
|
|
|
ab7d06 |
index c4a60fa..4d9979f 100644
|
|
|
ab7d06 |
--- a/include/nm-macros-internal.h
|
|
|
ab7d06 |
+++ b/include/nm-macros-internal.h
|
|
|
ab7d06 |
@@ -260,7 +260,8 @@ nm_clear_g_source (guint *id)
|
|
|
ab7d06 |
static inline gboolean
|
|
|
ab7d06 |
nm_clear_g_signal_handler (gpointer self, guint *id)
|
|
|
ab7d06 |
{
|
|
|
ab7d06 |
- g_return_val_if_fail (G_IS_OBJECT (self), FALSE);
|
|
|
ab7d06 |
+ if (!self)
|
|
|
ab7d06 |
+ return FALSE;
|
|
|
ab7d06 |
|
|
|
ab7d06 |
if (id && *id) {
|
|
|
ab7d06 |
g_signal_handler_disconnect (self, *id);
|
|
|
ab7d06 |
--
|
|
|
ab7d06 |
2.4.3
|
|
|
ab7d06 |
|
|
|
ab7d06 |
|
|
|
ab7d06 |
From 92bf4b9f07eb16fdb4eb550dcfb26dae1b167416 Mon Sep 17 00:00:00 2001
|
|
|
ab7d06 |
From: Thomas Haller <thaller@redhat.com>
|
|
|
ab7d06 |
Date: Mon, 12 Oct 2015 11:05:04 +0200
|
|
|
ab7d06 |
Subject: [PATCH 2/2] macros: remove early return from
|
|
|
ab7d06 |
nm_clear_g_signal_handler()
|
|
|
ab7d06 |
|
|
|
ab7d06 |
It is valid to call nm_clear_g_signal_handler() with missing
|
|
|
ab7d06 |
@self argument if (and only if) the @id is unspecified as well.
|
|
|
ab7d06 |
|
|
|
ab7d06 |
Remove the check for @self to get an assertion in case @id
|
|
|
ab7d06 |
is missing *and* @self is invalid. In this case,
|
|
|
ab7d06 |
g_signal_handler_disconnect() will raise a g_critical() for us.
|
|
|
ab7d06 |
|
|
|
ab7d06 |
Fixes: c33416178f88353b2f424a18c576de09b6ae3215
|
|
|
ab7d06 |
(cherry picked from commit 76958f94d4f7a8536dc6fa8676bd8de31bc661c1)
|
|
|
ab7d06 |
(cherry picked from commit 6f06ec0aba97c5dd89ffbe0f3592f3979d86d223)
|
|
|
ab7d06 |
---
|
|
|
ab7d06 |
include/nm-macros-internal.h | 3 ---
|
|
|
ab7d06 |
1 file changed, 3 deletions(-)
|
|
|
ab7d06 |
|
|
|
ab7d06 |
diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h
|
|
|
ab7d06 |
index 4d9979f..3c5adcc 100644
|
|
|
ab7d06 |
--- a/include/nm-macros-internal.h
|
|
|
ab7d06 |
+++ b/include/nm-macros-internal.h
|
|
|
ab7d06 |
@@ -260,9 +260,6 @@ nm_clear_g_source (guint *id)
|
|
|
ab7d06 |
static inline gboolean
|
|
|
ab7d06 |
nm_clear_g_signal_handler (gpointer self, guint *id)
|
|
|
ab7d06 |
{
|
|
|
ab7d06 |
- if (!self)
|
|
|
ab7d06 |
- return FALSE;
|
|
|
ab7d06 |
-
|
|
|
ab7d06 |
if (id && *id) {
|
|
|
ab7d06 |
g_signal_handler_disconnect (self, *id);
|
|
|
ab7d06 |
*id = 0;
|
|
|
ab7d06 |
--
|
|
|
ab7d06 |
2.4.3
|
|
|
ab7d06 |
|