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.
This commit is contained in:
Christian Hergert
2024-01-15 20:45:52 -08:00
parent 30020f1ac2
commit bc92ead2f1
3 changed files with 20 additions and 0 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);