From 0779f146ca40e6a32221e7fa8017dbc9d2d96525 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 4 Mar 2026 11:08:27 +0600 Subject: [PATCH] Memory fix --- source/ubinstall-gtk-kernel.c | 1 - source/ubinstall-gtk-region.c | 22 +++++++++++----------- source/ubinstall-gtk-ui-lang.c | 6 ++++++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/source/ubinstall-gtk-kernel.c b/source/ubinstall-gtk-kernel.c index affd164..8b4e5e6 100644 --- a/source/ubinstall-gtk-kernel.c +++ b/source/ubinstall-gtk-kernel.c @@ -288,7 +288,6 @@ void on_kernel_addon_info(GtkLabel *self){ yon_packages_info *info_struct = yon_packages_get_info_struct(YON_PACKAGES_ALL,package); if (!info_struct) return; char* info_string = yon_packages_get_info_string(info_struct); - yon_debug_output("%s\n",info_string); config_str info = yon_char_parse(info_string,&size,"\n"); if (size>0){ info_element *element = yon_package_info_element_new(); diff --git a/source/ubinstall-gtk-region.c b/source/ubinstall-gtk-region.c index 6beee65..22a3bf2 100644 --- a/source/ubinstall-gtk-region.c +++ b/source/ubinstall-gtk-region.c @@ -113,7 +113,7 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind char *timezone = (char*)cc_timezone_location_get_zone(location); GtkTreeIter iter; - int found = 0; + // int found = 0; for_iter(widgets->RegionTimezoneCompletionList,&iter){ char *render, *tz; gtk_tree_model_get(GTK_TREE_MODEL(widgets->RegionTimezoneCompletionList),&iter,0,&render,1,&tz,-1); @@ -124,20 +124,20 @@ void on_map_selection_changed(GtkWidget *,CcTimezoneLocation *location,main_wind gtk_entry_set_text(GTK_ENTRY(widgets->RegionEntry),render); char *utc = yon_timezone_get_utc(tz); yon_map_status_show(widgets,NULL,MAP_TITLE_LABEL(utc),render); - found = 1; + // found = 1; break; } } - if (!found){ - const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); - const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); - char *timezone = yon_char_unite(region,"/",zone,NULL); - g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); - cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),timezone); - g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); - free(timezone); - } + // if (!found){ + // const char *region = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->RegionCombo)); + // const char *zone = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->ZoneCombo)); + // char *timezone = yon_char_unite(region,"/",zone,NULL); + // g_signal_handlers_block_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); + // cc_timezone_map_set_timezone(CC_TIMEZONE_MAP(widgets->RegionMapTarget),timezone); + // g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RegionMapTarget),G_CALLBACK(on_map_selection_changed),widgets); + // free(timezone); + // } if (!yon_char_is_empty(region)) free(region); g_signal_handlers_unblock_by_func(G_OBJECT(widgets->ZoneCombo),G_CALLBACK(on_zone_changed),widgets); diff --git a/source/ubinstall-gtk-ui-lang.c b/source/ubinstall-gtk-ui-lang.c index 5b3c1be..9b343fd 100644 --- a/source/ubinstall-gtk-ui-lang.c +++ b/source/ubinstall-gtk-ui-lang.c @@ -67,17 +67,20 @@ void yon_startup_language_init(){ { if (size>0&&!yon_char_is_empty(parsed[0])&&strcmp(parsed[0],"(null)\n")){ yon_char_remove_last_symbol(parsed[0],'\n'); + if (strstr(parsed[0],"=")) free(yon_char_divide_search(parsed[0],"=",-1)); yon_config_register(installer_locale_parameter,installer_locale_parameter_command,parsed[0]); } if (size>1&&!yon_char_is_empty(parsed[1])&&strcmp(parsed[1],"(null)\n")){ yon_char_remove_last_symbol(parsed[1],'\n'); + if (strstr(parsed[0],"=")) free(yon_char_divide_search(parsed[1],"=",-1)); yon_char_remove_brackets(parsed[1]); yon_config_register(installer_locale_parameter,installer_locale_parameter_command,parsed[1]); } if (size>2&&!yon_char_is_empty(parsed[2])&&strcmp(parsed[2],"(null)\n")){ yon_char_remove_last_symbol(parsed[2],'\n'); + if (strstr(parsed[0],"=")) free(yon_char_divide_search(parsed[2],"=",-1)); yon_char_remove_brackets(parsed[2]); yon_config_register(installer_locale_parameter,installer_locale_parameter_command,parsed[2]); @@ -101,6 +104,9 @@ void yon_main_window_update_locale(main_window *widgets){ locale = lang; } } + if (yon_char_is_empty(locale)){ + locale = setlocale(LC_ALL,NULL); + } } setlocale(LC_ALL,(char *)locale); yon_config_register(installer_locale_parameter,installer_locale_parameter_command,(char*)locale);