Update crash fix

pull/12/head
parent ef8dc1fc03
commit 9ced914ce1

@ -12,23 +12,25 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
}
void on_config_local_load(GtkWidget *self,main_window *widgets){
if (!main_config.update_thread_active){
main_config.update_thread_active=1;
if (self){};
yon_load_proceed(YON_CONFIG_LOCAL);
yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
g_thread_new("",(GThreadFunc)yon_interface_update,widgets);
main_config.load_mode=1;
textdomain(template_ui_LocaleName);
textdomain(LocaleName);
}
}
void on_config_global_load(GtkWidget *self,main_window *widgets){
if (!main_config.update_thread_active){
main_config.update_thread_active=1;
if (self){};
yon_load_proceed(YON_CONFIG_GLOBAL);
yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
g_thread_new("",(GThreadFunc)yon_interface_update,widgets);
main_config.load_mode=0;
textdomain(template_ui_LocaleName);
textdomain(LocaleName);
}
}
@ -375,9 +377,11 @@ void *yon_unthreaded_config_load(void *widgets){
}
void on_update(GtkWidget *self,main_window *widgets){
if (!main_config.update_thread_active){
if (self){}
yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
g_thread_new("",(GThreadFunc)yon_unthreaded_config_load,widgets);
if (yon_unthreaded_config_load(widgets)){};
}
}
void *yon_interface_update(main_window *widgets){
@ -459,6 +463,7 @@ void *yon_interface_update(main_window *widgets){
}
textdomain(LocaleName);
gtk_tree_view_set_model(GTK_TREE_VIEW(widgets->MainTree),GTK_TREE_MODEL(widgets->liststore2));
main_config.update_thread_active=0;
return NULL;
}
@ -572,6 +577,7 @@ void config_init(){
main_config.lock_save_global=0;
main_config.lock_save_local=0;
main_config.load_mode=1;
main_config.update_thread_active=0;
}
void on_activate(GtkTreeView *self, main_window *widgets){
@ -662,8 +668,11 @@ void yon_main_window_complete(main_window *widgets){
gtk_tree_view_set_search_entry(GTK_TREE_VIEW(widgets->MainTree),GTK_ENTRY(widgets->SearchEntry));
yon_load_proceed(YON_CONFIG_LOCAL);
yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
if (!main_config.update_thread_active){
main_config.update_thread_active=1;
g_thread_new("",(GThreadFunc)yon_interface_update,widgets);
}
}
int main(int argc, char *argv[]){
local=setlocale(LC_ALL, "");

@ -67,6 +67,7 @@ typedef struct {
GtkTreeModel *AutolaunchFilter;
GtkTreeModel *StoppedFilter;
GtkTreeModel *BlockedFilter;
int update_thread_active;
} config;

Loading…
Cancel
Save