From: <des...@us...> - 2003-12-26 20:04:31
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv9396 Modified Files: dirbrowser.c prefswin.c Log Message: - plugged most memory leaks in dirbrowser - cleanups Index: dirbrowser.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/dirbrowser.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** dirbrowser.c 26 Dec 2003 08:30:15 -0000 1.17 --- dirbrowser.c 26 Dec 2003 20:04:28 -0000 1.18 *************** *** 25,47 **** #include <gdk/gdkx.h> - #include <sys/stat.h> - #include <unistd.h> - #include <dirent.h> - - #define FILENAME_COL 3 - - static GtkTreePath *current; - static GtkItemFactory *bmp_db_popup; - - static GtkWidget *progressbar_db; - static gboolean click_play = FALSE; ! static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget); ! static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data); ! static void bmp_db_set_icon(GtkWidget * win); --- 25,31 ---- #include <gdk/gdkx.h> ! #define FILENAME_COL 3 *************** *** 64,72 **** }; ! GtkAccelGroup *db_accel; ! GtkItemFactoryEntry bmp_db_menu_entries[] = { {N_("/_Enqueue"), "<alt>e", bmp_db_menu_callback, DIRBROWSER_ENQUEUE, "<StockItem>", GTK_STOCK_ADD}, --- 48,63 ---- }; + typedef struct { ! gchar *name; ! gchar *path_real; ! GdkPixbuf *image; + } db_node; ! static void bmp_db_menu_callback(gpointer data, guint action, ! GtkWidget * widget); ! ! static GtkItemFactoryEntry bmp_db_menu_entries[] = { {N_("/_Enqueue"), "<alt>e", bmp_db_menu_callback, DIRBROWSER_ENQUEUE, "<StockItem>", GTK_STOCK_ADD}, *************** *** 94,123 **** }; ! static const int bmp_db_menu_entries_num = sizeof(bmp_db_menu_entries) / sizeof(bmp_db_menu_entries[0]); ! typedef struct { ! ! gchar *name; ! gchar *path_real; ! GdkPixbuf *image; ! ! } db_node; ! ! GPtrArray *nodes; ! guint ctr_array = 0; ! static gchar *bmp_db_sanify_tag(gchar * value); static GtkTreeModel *bmp_db_return_filestore_model_fresh(GList * paths); /* The function adds a track to the model, specified by artist, album * and finally track. It creates artist and album nodes on the fly as * needed. Think of it as a "mkdir -p". */ ! ! static void bmp_db_mdb_add_track(gchar * arg_artist_p, ! gchar * arg_album_p, gchar * arg_track_p, ! guint arg_tracknum, gchar * arg_path, GtkTreeModel * model_sort) { --- 85,117 ---- }; ! static const gint bmp_db_menu_entries_num = sizeof(bmp_db_menu_entries) / sizeof(bmp_db_menu_entries[0]); + static GtkTreePath *current; + static GtkItemFactory *bmp_db_popup; + static GtkAccelGroup *db_accel; ! static GtkWidget *progressbar_db; ! static gboolean click_play = FALSE; + static GPtrArray *nodes; + static guint ctr_array = 0; ! static gboolean bmp_db_popup_menu(GtkWidget * widget, ! GdkEventButton * event, ! gpointer user_data); ! static void bmp_db_set_icon(GtkWidget * win); ! static gchar *bmp_db_sanify_tag(const gchar * value); static GtkTreeModel *bmp_db_return_filestore_model_fresh(GList * paths); + /* The function adds a track to the model, specified by artist, album * and finally track. It creates artist and album nodes on the fly as * needed. Think of it as a "mkdir -p". */ ! static void bmp_db_mdb_add_track(const gchar * arg_artist_p, ! const gchar * arg_album_p, ! const gchar * arg_track_p, ! guint arg_tracknum, ! const gchar * arg_path, GtkTreeModel * model_sort) { *************** *** 154,161 **** --- 148,158 ---- if (g_ascii_strcasecmp(value, arg_artist) == 0) { + g_free(value); found = TRUE; break; } + g_free(value); + valid = gtk_tree_model_iter_next(model, &iter); } *************** *** 190,193 **** --- 187,191 ---- g_free(value); + valid = gtk_tree_model_iter_next(model, &iter_albums); } *************** *** 223,226 **** --- 221,225 ---- g_free(value); + valid = gtk_tree_model_iter_next(model, &iter_tracks); } *************** *** 241,244 **** --- 240,247 ---- } + + g_free(arg_artist); + g_free(arg_album); + g_free(arg_track); } *************** *** 279,306 **** } ! static gchar *bmp_db_sanify_tag(gchar * value) { - - if (!value) - return "(unknown)"; - gchar *frag = NULL; gchar **branches; guint ctr = 0; gboolean bracket_open = FALSE; ! GString *chunk = g_string_new(NULL); ! branches = g_strsplit(g_strstrip(value), " ", 0); ! while (frag || (ctr == 0)) { ! if (ctr != 0) { g_string_append_c(chunk, ' '); - } frag = branches[ctr]; if (frag) { ! gchar *tmp = g_ascii_strdown(frag, -1); tmp[0] = g_ascii_toupper(tmp[0]); --- 282,314 ---- } ! static gchar *bmp_db_sanify_tag(const gchar * value) { gchar *frag = NULL; gchar **branches; + gchar *retval = NULL; + gchar *tmp; guint ctr = 0; gboolean bracket_open = FALSE; ! GString *chunk; ! if (!value) ! return g_strdup("(unknown)"); ! ! tmp = g_strstrip(g_strdup(value)); ! branches = g_strsplit(tmp, " ", 0); ! g_free(tmp); ! chunk = g_string_new(NULL); ! ! while (frag || !ctr) { ! ! if (ctr) g_string_append_c(chunk, ' '); frag = branches[ctr]; if (frag) { ! tmp = g_ascii_strdown(frag, -1); tmp[0] = g_ascii_toupper(tmp[0]); *************** *** 316,324 **** ctr++; - } ! /* FIXME: is chunk freed somewhere? */ ! return g_strstrip(chunk->str); } --- 324,333 ---- ctr++; } ! retval = g_strstrip(chunk->str); ! g_string_free(chunk, FALSE); ! ! return retval; } *************** *** 333,337 **** } ! static gchar *bmp_db_get_path_real(gchar * path, GtkTreeModel * model, GtkTreeIter * iter) { --- 342,346 ---- } ! static gchar *bmp_db_get_path_real(const gchar * path, GtkTreeModel * model, GtkTreeIter * iter) { *************** *** 350,354 **** ! static void bmp_db_create_dirtree(GtkTreeModel * model, gchar * from, GtkTreeIter parent_iter) { --- 359,363 ---- ! static void bmp_db_create_dirtree(GtkTreeModel * model, const gchar * root, GtkTreeIter parent_iter) { *************** *** 356,362 **** GList *dirs = NULL; GList *files = NULL; ! DIR *dir; ! struct dirent *dirent; ! struct stat statbuf; GtkTreeIter iter; --- 365,369 ---- GList *dirs = NULL; GList *files = NULL; ! GDir *dir; GtkTreeIter iter; *************** *** 364,372 **** GList *list = NULL; gboolean first = TRUE; ! gchar *from_real; ! from = g_locale_from_utf8(from, -1, NULL, NULL, NULL); ! from_real = bmp_db_get_path_real(from, model, &parent_iter); ! g_free(from); /* It's not really a waste creating both beforehand since we will --- 371,386 ---- GList *list = NULL; gboolean first = TRUE; ! gchar *root_utf8, *root_real; ! const gchar *dirent; ! root_utf8 = g_locale_from_utf8(root, -1, NULL, NULL, NULL); ! root_real = bmp_db_get_path_real(root, model, &parent_iter); ! ! if (!g_file_test(root_real, G_FILE_TEST_IS_DIR)) ! { ! g_free(root_utf8); ! g_free(root_real); ! return; ! } /* It's not really a waste creating both beforehand since we will *************** *** 389,397 **** ! stat(from_real, &statbuf); ! if ((statbuf.st_mode & S_IFDIR) != S_IFDIR) ! return; ! ! if ((list = input_scan_dir(from_real)) != NULL) { /* We enter a directory that has been "hijacked" by an * input-plugin. This is used by the CDDA plugin */ --- 403,407 ---- ! if ((list = input_scan_dir(root_real)) != NULL) { /* We enter a directory that has been "hijacked" by an * input-plugin. This is used by the CDDA plugin */ *************** *** 400,422 **** files = list; } else { ! if ((dir = opendir(from_real)) != NULL) { ! while ((dirent = readdir(dir)) != NULL) { ! char *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent->d_name[0] == '.') continue; name_real = ! g_build_filename(from_real, dirent->d_name, NULL); ! stat(name_real, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { dirs = g_list_append(dirs, ! g_locale_to_utf8(dirent->d_name, -1, NULL, NULL, NULL)); } } ! closedir(dir); } --- 410,432 ---- files = list; } else { ! if ((dir = g_dir_open(root_real, 0, NULL)) != NULL) { ! while ((dirent = g_dir_read_name(dir)) != NULL) { ! gchar *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent[0] == '.') continue; + name_real = ! g_build_filename(root_real, dirent, NULL); ! if (g_file_test(name_real, G_FILE_TEST_IS_DIR)) { dirs = g_list_append(dirs, ! g_locale_to_utf8(dirent, -1, NULL, NULL, NULL)); } } ! g_dir_close(dir); } *************** *** 481,488 **** db_node *node; gchar *filename; ! FILE *file; ! gchar *buffer, **lines, **frags; ! struct stat stats; ! guint i; GdkPixbuf *buf; --- 491,498 ---- db_node *node; gchar *filename; ! gsize filesize; ! gchar *buffer; ! gchar **lines, **current_line; ! gchar **frags; GdkPixbuf *buf; *************** *** 499,531 **** g_build_filename(g_get_home_dir(), BMP_RCPATH, "dbrc", NULL); ! if (!(file = fopen(filename, "r"))) { ! /* Seems the file doesn't exist so give at least the root filesystem */ ! if (!(file = fopen(filename, "w"))) { ! /* Ok now we really give up */ ! return NULL; ! } ! fprintf(file, "/:/\n"); ! /* not so cool */ ! fclose(file); ! file = fopen(filename, "r"); } ! lstat(filename, &stats); ! buffer = g_malloc(stats.st_size + 1); ! if (fread(buffer, 1, stats.st_size, file) != stats.st_size) { ! g_free(buffer); ! fclose(file); return NULL; } ! fclose(file); ! buffer[stats.st_size] = '\0'; lines = g_strsplit(buffer, "\n", 0); g_free(buffer); ! i = 0; ! while (lines[i]) { ! if (strlen(lines[i])) { ! ! frags = g_strsplit(lines[i], ":", 0); node = g_malloc0(sizeof(db_node)); --- 509,531 ---- g_build_filename(g_get_home_dir(), BMP_RCPATH, "dbrc", NULL); ! if (!g_file_test(filename, G_FILE_TEST_EXISTS)) ! { ! g_free(filename); ! return NULL; } ! if (!g_file_get_contents(filename, &buffer, &filesize, NULL)) ! { ! g_free(filename); return NULL; } ! lines = g_strsplit(buffer, "\n", 0); g_free(buffer); ! current_line = lines; ! while (*current_line) { ! if (strlen(*current_line)) { ! frags = g_strsplit(*current_line, ":", 0); node = g_malloc0(sizeof(db_node)); *************** *** 541,547 **** bmp_db_create_dirtree(GTK_TREE_MODEL(model), /* starting at */ "/", iter); g_strfreev(frags); } ! i++; } --- 541,548 ---- bmp_db_create_dirtree(GTK_TREE_MODEL(model), /* starting at */ "/", iter); + g_strfreev(frags); } ! current_line++; } *************** *** 670,673 **** --- 671,675 ---- gchar *path; gchar *path_real; + gchar *tmp; GtkTreeModel *model; *************** *** 677,681 **** model = gtk_tree_view_get_model(treeview); - /* FIXME: paths is not freed */ paths = bmp_db_get_paths_from_selection(treeview); --- 679,682 ---- *************** *** 686,697 **** gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &node_name, -1); ! path = bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); ! /* FIXME: path is not freed */ ! path = g_locale_from_utf8(path, -1, NULL, NULL, NULL); path_real = bmp_db_get_path_real(path, model, &iter); ! /* FIXME: paths_f is not freed */ paths_f = g_list_append(paths_f, path_real); --- 687,699 ---- gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &node_name, -1); ! tmp = bmp_db_path_get_full(GTK_TREE_MODEL(model), node_name, iter); ! path = g_locale_from_utf8(tmp, -1, NULL, NULL, NULL); path_real = bmp_db_get_path_real(path, model, &iter); ! g_free(tmp); ! g_free(path); ! paths_f = g_list_append(paths_f, path_real); *************** *** 699,702 **** --- 701,707 ---- } + g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); + g_list_free(paths); + GtkWidget *store = GTK_WIDGET(bmp_db_return_filestore_model_fresh(paths_f)); *************** *** 704,707 **** --- 709,715 ---- gtk_tree_view_set_model(user_data, GTK_TREE_MODEL(store)); gtk_widget_set_sensitive(user_data, TRUE); + + g_list_foreach(paths_f, (GFunc) g_free, NULL); + g_list_free(paths_f); } *************** *** 722,726 **** gint entry_type = -1; - struct stat statbuf; GtkTreeModel *model; --- 730,733 ---- *************** *** 731,743 **** &node_name, 4, &entry_type, -1); ! if ((node_name != NULL) && (entry_type == IS_TRACK)) { if (click_play) playlist_clear(); ! stat(node_name, &statbuf); ! if (S_ISREG(statbuf.st_mode)) { playlist_add_url_string(node_name); - } if (click_play) --- 738,748 ---- &node_name, 4, &entry_type, -1); ! if (node_name && entry_type == IS_TRACK) { if (click_play) playlist_clear(); ! if (g_file_test(node_name, G_FILE_TEST_IS_REGULAR)) playlist_add_url_string(node_name); if (click_play) *************** *** 757,763 **** gtk_tree_model_get(GTK_TREE_MODEL(model), &iter_child, FILENAME_COL, &node_name, -1); ! if (node_name != NULL) { ! stat(node_name, &statbuf); ! if (S_ISREG(statbuf.st_mode)) { playlist_add_url_string(node_name); } --- 762,767 ---- gtk_tree_model_get(GTK_TREE_MODEL(model), &iter_child, FILENAME_COL, &node_name, -1); ! if (node_name) { ! if (g_file_test(node_name, G_FILE_TEST_IS_REGULAR)) { playlist_add_url_string(node_name); } *************** *** 792,797 **** while (paths) { - struct stat statbuf; - gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, paths->data); gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, 1, &node_name, --- 796,799 ---- *************** *** 803,808 **** path_real = bmp_db_get_path_real(path, model, &iter); ! stat(path, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { playlist_add_dir(path_real); } else { --- 805,809 ---- path_real = bmp_db_get_path_real(path, model, &iter); ! if (g_file_test(path, G_FILE_TEST_IS_DIR)) { playlist_add_dir(path_real); } else { *************** *** 810,820 **** } paths = paths->next; } ! g_free(paths); ! bmp_db_clear_clicked(NULL, data); } --- 811,825 ---- } + g_free(path); + g_free(path_real); + paths = paths->next; } ! g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); ! g_list_free(paths); + bmp_db_clear_clicked(NULL, data); } *************** *** 822,826 **** { GList *paths = NULL; ! /* paths is not freed */ paths = bmp_db_get_paths_from_selection(GTK_TREE_VIEW(data)); while (paths) { --- 827,831 ---- { GList *paths = NULL; ! paths = bmp_db_get_paths_from_selection(GTK_TREE_VIEW(data)); while (paths) { *************** *** 829,832 **** --- 834,839 ---- } + g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); + g_list_free(paths); } *************** *** 858,863 **** gchar *path_real; - struct stat statbuf; - attrs = pango_attr_list_new(); attr = pango_attr_weight_new(PANGO_WEIGHT_BOLD); --- 865,868 ---- *************** *** 910,915 **** path_real = bmp_db_get_path_real(path, model, &iter); ! stat(path_real, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { db_node *node; --- 915,919 ---- path_real = bmp_db_get_path_real(path, model, &iter); ! if (g_file_test(path_real, G_FILE_TEST_IS_DIR)) { db_node *node; *************** *** 1036,1040 **** model = gtk_tree_view_get_model(GTK_TREE_VIEW(data)); - /* paths is not freed */ paths = gtk_tree_selection_get_selected_rows(GTK_TREE_SELECTION(selection), --- 1040,1043 ---- *************** *** 1044,1052 **** while (paths) { ! ! char *node_name; ! char *path; ! char *path_real; ! struct stat statbuf; gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, paths->data); --- 1047,1053 ---- while (paths) { ! gchar *node_name; ! gchar *path; ! gchar *path_real; gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, paths->data); *************** *** 1058,1063 **** path_real = bmp_db_get_path_real(path, model, &iter); ! stat(path, &statbuf); ! if (S_ISDIR(statbuf.st_mode)) { playlist_add_dir(path_real); } else { --- 1059,1063 ---- path_real = bmp_db_get_path_real(path, model, &iter); ! if (g_file_test(path, G_FILE_TEST_IS_DIR)) { playlist_add_dir(path_real); } else { *************** *** 1066,1072 **** paths = paths->next; - } bmp_db_clear_clicked(NULL, data); playlist_play(); --- 1066,1074 ---- paths = paths->next; } + g_list_foreach(paths, (GFunc) gtk_tree_path_free, NULL); + g_list_free(paths); + bmp_db_clear_clicked(NULL, data); playlist_play(); *************** *** 1265,1282 **** ! static GList *bmp_db_return_files_from_path(gchar * path) { ! DIR *dir; ! struct dirent *dirent; ! struct stat statbuf; GList *list = NULL; GList *files = NULL; ! stat(path, &statbuf); ! if ((statbuf.st_mode & S_IFDIR) != S_IFDIR) { /* FIXME: Add action for no directory */ return NULL; - } if ((list = input_scan_dir(path)) != NULL) { --- 1267,1281 ---- ! static GList *bmp_db_return_files_from_path(const gchar * path) { ! GDir *dir; ! const gchar *dirent; GList *list = NULL; GList *files = NULL; ! if (!g_file_test(path, G_FILE_TEST_IS_DIR)) /* FIXME: Add action for no directory */ return NULL; if ((list = input_scan_dir(path)) != NULL) { *************** *** 1289,1313 **** files = list; } else { ! if ((dir = opendir(path)) != NULL) { ! while ((dirent = readdir(dir)) != NULL) { ! char *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent->d_name[0] == '.') { continue; ! } ! name_real = ! g_strdup(g_strconcat(path, "/", dirent->d_name, NULL)); ! stat(name_real, &statbuf); ! if (S_ISREG(statbuf.st_mode)) { if (bmp_db_check_file(name_real)) { ! files = g_list_append(files, ! g_strdup(g_filename_to_utf8 ! (name_real, -1, ! NULL, NULL, ! NULL))); } } } ! closedir(dir); } --- 1288,1307 ---- files = list; } else { ! if ((dir = g_dir_open(path, 0, NULL)) != NULL) { ! while ((dirent = g_dir_read_name(dir)) != NULL) { ! gchar *name_real; /* FIXME: Excludes hidden dirs too (do we want them anyway?) */ ! if (dirent[0] == '.') continue; ! ! name_real = g_build_filename(path, dirent, NULL); ! ! if (g_file_test(name_real, G_FILE_TEST_IS_REGULAR)) { if (bmp_db_check_file(name_real)) { ! files = g_list_append(files, g_filename_to_utf8(name_real, -1, NULL, NULL,NULL)); } } } ! g_dir_close(dir); } *************** *** 1317,1321 **** } - static GtkTreeModel *bmp_db_return_filestore_model_fresh(GList * paths) { --- 1311,1314 ---- *************** *** 1323,1327 **** GtkTreeStore *file_store; - file_store = gtk_tree_store_new(5, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT, --- 1316,1319 ---- *************** *** 1335,1366 **** NULL); - gdouble length_pl = g_list_length(paths); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_db), 0.0); ! int ctr = 0; while (paths) { ! gchar *path = paths->data; - ctr++; - GList *files = bmp_db_return_files_from_path(path); while (files) { - gchar *title; - gchar *artist; - gchar *album; - gchar *genre; - guint tracknumber; - input_return_tag_value_by_name(files->data, &artist, &title, &album, &genre, &tracknumber); ! if (title == NULL) { ! ! title = g_strdup(g_basename(files->data)); title[strlen(title) - 4] = 0; - } --- 1327,1351 ---- NULL); gdouble length_pl = g_list_length(paths); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar_db), 0.0); ! gint ctr = 0; while (paths) { ! gchar *title; ! gchar *artist; ! gchar *album; ! gchar *genre; ! guint tracknumber; gchar *path = paths->data; GList *files = bmp_db_return_files_from_path(path); while (files) { input_return_tag_value_by_name(files->data, &artist, &title, &album, &genre, &tracknumber); ! if (!title) { ! title = g_path_get_basename(files->data); title[strlen(title) - 4] = 0; } *************** *** 1368,1371 **** --- 1353,1361 ---- files->data, sort_model); + g_free(artist); + g_free(title); + g_free(album); + g_free(genre); + files = files->next; } *************** *** 1377,1381 **** --- 1367,1373 ---- gtk_main_iteration(); }; + paths = paths->next; + ctr++; } *************** *** 1418,1422 **** GtkWidget *bmp_db_create(const gchar * current_path) { ! static GtkWidget *window; GtkWidget *vbox_right; GtkWidget *vbox_left; --- 1410,1414 ---- GtkWidget *bmp_db_create(const gchar * current_path) { ! static GtkWidget *window = NULL; GtkWidget *vbox_right; GtkWidget *vbox_left; *************** *** 1508,1517 **** /* FIXME: clean up variables, move them to start */ - /* FIXME: paths is not freed, and is resetted every iteration */ GList *paths = NULL; paths = g_list_append(paths, g_strdup(g_get_home_dir())); fstore = bmp_db_return_filestore_fresh(paths); gtk_container_add(GTK_CONTAINER(sw_right), fstore); GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); --- 1500,1511 ---- /* FIXME: clean up variables, move them to start */ GList *paths = NULL; paths = g_list_append(paths, g_strdup(g_get_home_dir())); + fstore = bmp_db_return_filestore_fresh(paths); gtk_container_add(GTK_CONTAINER(sw_right), fstore); + g_list_free(paths); + GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); *************** *** 1527,1530 **** --- 1521,1525 ---- } + gtk_widget_realize(window); bmp_db_set_icon(window); Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** prefswin.c 26 Dec 2003 15:55:56 -0000 1.10 --- prefswin.c 26 Dec 2003 20:04:28 -0000 1.11 *************** *** 506,514 **** void prefswin_mainwin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel; gint response; gchar *fontname; ! if (fontsel != NULL) return; --- 506,514 ---- void prefswin_mainwin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel = NULL; gint response; gchar *fontname; ! if (fontsel) return; |