[gnome-network-displays/benzea/fix-p2p-sink-removal: 2/3] meta-sink: Fix critical warning when there is no sink
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-network-displays/benzea/fix-p2p-sink-removal: 2/3] meta-sink: Fix critical warning when there is no sink
- Date: Tue, 13 Oct 2020 15:32:43 +0000 (UTC)
commit e0af7958ff542b8b20f4d2c0d5b6a1ddc77144f6
Author: Benjamin Berg <bberg redhat com>
Date: Tue Oct 13 17:31:42 2020 +0200
meta-sink: Fix critical warning when there is no sink
A meta sink can be empty (i.e. have no child sinks). In this case, the
finalize handler cannot disconnect anymore. Just add the appropriate
guard.
src/nd-meta-sink.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/nd-meta-sink.c b/src/nd-meta-sink.c
index d5ed075..45f3368 100644
--- a/src/nd-meta-sink.c
+++ b/src/nd-meta-sink.c
@@ -223,7 +223,8 @@ nd_meta_sink_finalize (GObject *object)
g_ptr_array_free (meta_sink->sinks, TRUE);
meta_sink->sinks = NULL;
- g_signal_handlers_disconnect_by_data (meta_sink->current_sink, meta_sink);
+ if (meta_sink->current_sink)
+ g_signal_handlers_disconnect_by_data (meta_sink->current_sink, meta_sink);
g_clear_object (&meta_sink->current_sink);
G_OBJECT_CLASS (nd_meta_sink_parent_class)->finalize (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]