From 0c004b520406c9ac61c15d1f5033060b2f60b748 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Fri, 20 Jan 2023 18:20:24 +0100 Subject: [PATCH] application: Only destroy previously created widgets If this is not the primary instance self->main_window and self->call_window will not have been created in the first place. Fixes: e878fabb27a924aec1bbff0522dbf52a17158155 --- src/calls-application.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/calls-application.c b/src/calls-application.c index 63da52d..3d5efbd 100644 --- a/src/calls-application.c +++ b/src/calls-application.c @@ -686,8 +686,10 @@ finalize (GObject *object) g_clear_handle_id (&self->id_sigterm, g_source_remove); g_clear_handle_id (&self->id_sigint, g_source_remove); - gtk_widget_destroy (GTK_WIDGET (self->main_window)); - gtk_widget_destroy (GTK_WIDGET (self->call_window)); + if (self->main_window) + gtk_widget_destroy (GTK_WIDGET (self->main_window)); + if (self->call_window) + gtk_widget_destroy (GTK_WIDGET (self->call_window)); g_clear_object (&self->record_store); g_clear_object (&self->ringer);