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