From 6d335902bc663e56403a9613cb5d03e0825ffcd5 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Tue, 31 Mar 2026 14:28:29 +0600 Subject: [PATCH] Fixed crash --- source/ubinstall-gtk-log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ubinstall-gtk-log.c b/source/ubinstall-gtk-log.c index a9fee30..dd183c4 100644 --- a/source/ubinstall-gtk-log.c +++ b/source/ubinstall-gtk-log.c @@ -129,7 +129,7 @@ void yon_installation_progress_update(GFileMonitor *,GFile *,GFile *,GFileMonito g_mutex_unlock(&main_config.progress_mutex); - if (size) { + if (size&&text) { if (!yon_char_is_empty(text[size-1]) && text[size-1][0] == '(') { char *current_copy = yon_char_new(text[size-1]); char *percentage = yon_char_divide_search(current_copy, ")", -1); @@ -149,13 +149,12 @@ void yon_installation_progress_update(GFileMonitor *,GFile *,GFile *,GFileMonito double fraction = atof(parsed[3]) / 100; gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress), fraction); gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel), yon_char_parsed_to_string(parsed, size, " ")); - yon_char_parsed_free(parsed,size); + // yon_char_parsed_free(parsed,size); } if (!yon_char_is_empty(current_copy)) free(current_copy); } } - yon_char_parsed_free(text, size); size=0; text=NULL; } @@ -165,6 +164,7 @@ gboolean yon_progress_bar_start(main_window *widgets){ GFile *file_desc = g_file_new_for_path(progress_path); widgets->install_info_monitor = g_file_monitor_file(file_desc,G_FILE_MONITOR_NONE,NULL,NULL); g_signal_connect(G_OBJECT(widgets->install_info_monitor),"changed",G_CALLBACK(yon_installation_progress_update),widgets); + // g_thread_new("progress",(GThreadFunc)yon_progress_thread_test,widgets); g_object_unref(file_desc); if (access(progress_path,F_OK)){ FILE *file = fopen(progress_path,"w");