From 3333aa06ca2b620c07995f41c05a273dad7af908 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Thu, 15 Jan 2026 15:02:14 +0000 Subject: [PATCH] Test fix for crash --- source/ubinstall-gtk-log.c | 8 ++++++++ source/ubinstall-gtk-page-switch.c | 5 +++-- source/ubinstall-gtk-saving.c | 5 +---- source/ubinstall-gtk.h | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/source/ubinstall-gtk-log.c b/source/ubinstall-gtk-log.c index 2721583..77f24c3 100644 --- a/source/ubinstall-gtk-log.c +++ b/source/ubinstall-gtk-log.c @@ -123,3 +123,11 @@ void yon_installation_progress_update(GFileMonitor *,GFile *,GFile *,GFileMonito text=NULL; } } + +gboolean yon_probress_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_object_unref(file_desc); + return G_SOURCE_REMOVE; +} \ No newline at end of file diff --git a/source/ubinstall-gtk-page-switch.c b/source/ubinstall-gtk-page-switch.c index fb8f0ba..b57c988 100644 --- a/source/ubinstall-gtk-page-switch.c +++ b/source/ubinstall-gtk-page-switch.c @@ -494,8 +494,9 @@ void on_page_cancel_clicked(GtkWidget *, main_window *widgets){ data->title=WARNING_TITLE_LABEL; if (yon_confirmation_dialog_call(widgets->MainWindow,data)==GTK_RESPONSE_ACCEPT ){ pthread_cancel(main_config.install_thread); - g_file_monitor_cancel(widgets->install_progress_monitor); - widgets->install_progress_monitor = NULL; + g_signal_handlers_disconnect_by_func(G_OBJECT(widgets->install_info_monitor),yon_installation_progress_update,widgets); + g_file_monitor_cancel(widgets->install_info_monitor); + widgets->install_info_monitor = NULL; gtk_button_set_label(GTK_BUTTON(widgets->NextButton),NEXT_LABEL); GtkWidget *image = gtk_button_get_image(GTK_BUTTON(widgets->NextButton)); gtk_image_set_from_icon_name(GTK_IMAGE(image),arrow_right_icon_path,GTK_ICON_SIZE_BUTTON); diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index 055fa25..2bd4b02 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -184,10 +184,7 @@ void *on_config_save(void *data){ if (file){ fclose(file); } - 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_object_unref(file_desc); + g_idle_add((GSourceFunc)yon_probress_bar_start,widgets); if (!main_config.dry_run){ char *command = yon_debug_output("%s\n",save_config_command(yon_char_parsed_to_string(parameters,size," "))); yon_char_parsed_free(parameters,size); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 2e0890a..6ad64d9 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1454,4 +1454,5 @@ void yon_os_password_open(GtkWidget *, main_window *widgets); void yon_userdata_password_open(GtkWidget *, main_window *widgets); double yon_password_check_func(yon_password_window *window, const char *password_string); void yon_source_update(source_window *window); -void yon_main_window_update_locale(main_window *widgets); \ No newline at end of file +void yon_main_window_update_locale(main_window *widgets); +gboolean yon_probress_bar_start(main_window *widgets); \ No newline at end of file