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: e878fabb27
This commit is contained in:
Evangelos Ribeiro Tzaras
2023-01-20 18:20:24 +01:00
parent 481c67a707
commit 0c004b5204

View File

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