Fixed crash at status box despawning

pull/24/head
Администратор 1 year ago
parent 1101765154
commit ac4d8323e4

@ -928,21 +928,30 @@ int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *status_id,
}
}
int delete_busy=0;
int _yon_ubl_status_box_despawn_infinite(GtkContainer *container){
if (yon_status_thread_id){
free(yon_status_thread_id);
yon_status_thread_id=NULL;
}
GList *list = gtk_container_get_children(container);
for (int i=0; i<g_list_length(list);i++){
GtkWidget *revealer = g_list_nth_data(list,i);
if (GTK_IS_REVEALER(revealer)){
gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),0);
usleep(200000);
if (!delete_busy){
delete_busy=1;
if (yon_status_thread_id){
free(yon_status_thread_id);
yon_status_thread_id=NULL;
}
GList *list = gtk_container_get_children(container);
for (int i=0; i<g_list_length(list);i++){
GtkWidget *revealer = g_list_nth_data(list,i);
g_list_free(list);
if (GTK_IS_REVEALER(revealer)){
gtk_widget_destroy(revealer);
gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),0);
usleep(200000);
list = gtk_container_get_children(container);
if (g_list_length>0){
if (GTK_IS_REVEALER(revealer)){
gtk_widget_destroy(revealer);
}
}
}
}
delete_busy=0;
}
}

Loading…
Cancel
Save