From b392b74e02da388a37258e0675f6559c9a97fb58 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 20 Jun 2025 03:15:04 +0000 Subject: [PATCH] crash fix --- source/ubl-settings-video.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 4ae67cf..b1718fd 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -77,8 +77,8 @@ gboolean on_terminal_check_progress(main_window *widgets){ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel), percentage / 100); g_free(last_match); } - g_free(text); - g_match_info_unref(match); + if (text) g_free(text); + if (match) g_match_info_unref(match); g_mutex_lock(&main_config.progress_mutex); if (percentage>99||!main_config.progress_active){ @@ -91,6 +91,9 @@ gboolean on_terminal_check_progress(main_window *widgets){ } void on_command_cancel(GtkWidget *,main_window *widgets){ + g_mutex_lock(&main_config.progress_mutex); + main_config.progress_active=0; + g_mutex_unlock(&main_config.progress_mutex); gtk_widget_destroy(widgets->TerminalRevealer); }