From bc92ead2f1892dcaddf0a5cc5e5aaf6980ce06f3 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 15 Jan 2024 20:45:52 -0800 Subject: [PATCH] sysprof: clear column view models before chaining up dispose This works around an issue caused by GNOME/gtk!6758 which has caused an infloop of warnings trying to cleanup GtkColumnView. --- src/sysprof/sysprof-callgraph-view.c | 9 +++++++++ src/sysprof/sysprof-cpu-section.c | 8 ++++++++ src/sysprof/sysprof-network-section.c | 3 +++ 3 files changed, 20 insertions(+) diff --git a/src/sysprof/sysprof-callgraph-view.c b/src/sysprof/sysprof-callgraph-view.c index ce089d52..f8f10aab 100644 --- a/src/sysprof/sysprof-callgraph-view.c +++ b/src/sysprof/sysprof-callgraph-view.c @@ -339,6 +339,15 @@ sysprof_callgraph_view_dispose (GObject *object) { SysprofCallgraphView *self = (SysprofCallgraphView *)object; + if (self->functions_column_view) + gtk_column_view_set_model (self->functions_column_view, NULL); + + if (self->callers_column_view) + gtk_column_view_set_model (self->callers_column_view, NULL); + + if (self->descendants_column_view) + gtk_column_view_set_model (self->descendants_column_view, NULL); + if (self->traceables_signals) { g_signal_group_set_target (self->traceables_signals, NULL); diff --git a/src/sysprof/sysprof-cpu-section.c b/src/sysprof/sysprof-cpu-section.c index 5b9d050f..41426ef3 100644 --- a/src/sysprof/sysprof-cpu-section.c +++ b/src/sysprof/sysprof-cpu-section.c @@ -36,6 +36,7 @@ struct _SysprofCpuSection SysprofTimeScrubber *scrubber; GtkColumnView *column_view; + GtkColumnView *cpu_column_view; GtkColumnViewColumn *time_column; }; @@ -46,6 +47,12 @@ sysprof_cpu_section_dispose (GObject *object) { SysprofCpuSection *self = (SysprofCpuSection *)object; + if (self->column_view) + gtk_column_view_set_model (self->column_view, NULL); + + if (self->cpu_column_view) + gtk_column_view_set_model (self->cpu_column_view, NULL); + gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_CPU_SECTION); G_OBJECT_CLASS (sysprof_cpu_section_parent_class)->dispose (object); @@ -61,6 +68,7 @@ sysprof_cpu_section_class_init (SysprofCpuSectionClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-cpu-section.ui"); gtk_widget_class_bind_template_child (widget_class, SysprofCpuSection, column_view); + gtk_widget_class_bind_template_child (widget_class, SysprofCpuSection, cpu_column_view); gtk_widget_class_bind_template_child (widget_class, SysprofCpuSection, scrubber); gtk_widget_class_bind_template_child (widget_class, SysprofCpuSection, time_column); diff --git a/src/sysprof/sysprof-network-section.c b/src/sysprof/sysprof-network-section.c index d1b51f34..ecd68d93 100644 --- a/src/sysprof/sysprof-network-section.c +++ b/src/sysprof/sysprof-network-section.c @@ -113,6 +113,9 @@ sysprof_network_section_dispose (GObject *object) { SysprofNetworkSection *self = (SysprofNetworkSection *)object; + if (self->column_view != NULL) + gtk_column_view_set_model (self->column_view, NULL); + gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_NETWORK_SECTION); g_clear_object (&self->pairs);