Merge pull request 'Fixed package info re-get crash' (#70) from YanTheKaller/libublsettings-gtk3:master into master

Reviewed-on: #70
pull/71/head^2 v1.65
Dmitry Razumov 2 months ago
commit bdf796b511

@ -304,11 +304,11 @@ yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type,
size_t size=0; size_t size=0;
alpm_list_t *licence_list = alpm_pkg_get_licenses(pkg); alpm_list_t *licence_list = alpm_pkg_get_licenses(pkg);
package_info->licence = yon_alpm_list_to_char(licence_list); package_info->licence = yon_alpm_list_to_char(licence_list);
alpm_list_free(licence_list); // alpm_list_free(licence_list);
alpm_list_t *groups_list = alpm_pkg_get_groups(pkg); alpm_list_t *groups_list = alpm_pkg_get_groups(pkg);
package_info->groups = yon_alpm_list_to_char(groups_list); package_info->groups = yon_alpm_list_to_char(groups_list);
alpm_list_free(groups_list); // alpm_list_free(groups_list);
{ {
alpm_list_t *provides_list = alpm_pkg_get_provides(pkg); alpm_list_t *provides_list = alpm_pkg_get_provides(pkg);
@ -319,7 +319,7 @@ yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type,
yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)provides_list->data)->name); yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)provides_list->data)->name);
} }
package_info->provides = yon_char_parsed_to_string(parsed,parsed_size, " "); package_info->provides = yon_char_parsed_to_string(parsed,parsed_size, " ");
alpm_list_free(provides_list); // alpm_list_free(provides_list);
} }
{ {
@ -331,7 +331,7 @@ yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type,
yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)depends_list->data)->name); yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)depends_list->data)->name);
} }
package_info->depends = yon_char_parsed_to_string(parsed,parsed_size, " "); package_info->depends = yon_char_parsed_to_string(parsed,parsed_size, " ");
alpm_list_free(depends_list); // alpm_list_free(depends_list);
} }
{ {
@ -343,7 +343,7 @@ yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type,
yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)optdepends_list->data)->name); yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)optdepends_list->data)->name);
} }
package_info->optional_depends = yon_char_parsed_to_string(parsed,parsed_size, " "); package_info->optional_depends = yon_char_parsed_to_string(parsed,parsed_size, " ");
alpm_list_free(optdepends_list); // alpm_list_free(optdepends_list);
} }
{ {
@ -355,7 +355,7 @@ yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type,
yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)conflicts_list->data)->name); yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)conflicts_list->data)->name);
} }
package_info->conflicts = yon_char_parsed_to_string(parsed,parsed_size, " "); package_info->conflicts = yon_char_parsed_to_string(parsed,parsed_size, " ");
alpm_list_free(conflicts_list); // alpm_list_free(conflicts_list);
} }
{ {
@ -367,7 +367,7 @@ yon_packages_info *yon_packages_get_info_struct(enum YON_PACKAGES_DB_TYPE type,
yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)replaces_list->data)->name); yon_char_parsed_add_or_create_if_exists(parsed,&parsed_size,((alpm_depend_t*)replaces_list->data)->name);
} }
package_info->replaces = yon_char_parsed_to_string(parsed,parsed_size, " "); package_info->replaces = yon_char_parsed_to_string(parsed,parsed_size, " ");
alpm_list_free(replaces_list); // alpm_list_free(replaces_list);
} }
int size_mod = 0; int size_mod = 0;

@ -231,11 +231,13 @@ void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int ti
guint len = g_list_length(list); guint len = g_list_length(list);
if (len>=3){ if (len>=3){
struct status_struct *status = g_object_get_data(G_OBJECT(g_list_nth_data(list,len-3)),"status_struct"); struct status_struct *status = g_object_get_data(G_OBJECT(g_list_nth_data(list,len-3)),"status_struct");
g_mutex_lock(&status_remove_mutex); if (status->thread){
if (status&&gtk_revealer_get_reveal_child(GTK_REVEALER(status->revealer))){ g_mutex_lock(&status_remove_mutex);
yon_status_struct_destroy(status); if (status&&gtk_revealer_get_reveal_child(GTK_REVEALER(status->revealer))){
yon_status_struct_destroy(status);
}
g_mutex_unlock(&status_remove_mutex);
} }
g_mutex_unlock(&status_remove_mutex);
} }
struct status_struct *status = yon_status_struct_new(); struct status_struct *status = yon_status_struct_new();

Loading…
Cancel
Save