comparison src/gtkprefs.c @ 8494:8a1421dcef60

[gaim-migrate @ 9229] Fix a memleak when adding smiley themes and leave a note about another possible leak. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 24 Mar 2004 01:37:04 +0000
parents b7f13b782f8b
children 7dcd6f26e4a7
comparison
equal deleted inserted replaced
8493:244a49ab79ef 8494:8a1421dcef60
419 struct smiley_theme *theme = themes->data; 419 struct smiley_theme *theme = themes->data;
420 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n" 420 char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
421 "<span size='smaller' foreground='dim grey'>%s</span>", 421 "<span size='smaller' foreground='dim grey'>%s</span>",
422 theme->name, theme->author, theme->desc); 422 theme->name, theme->author, theme->desc);
423 gtk_list_store_append (smiley_theme_store, &iter); 423 gtk_list_store_append (smiley_theme_store, &iter);
424
425 /*
426 * LEAK - Gentoo memprof thinks pixbuf is leaking here... but it
427 * looks like it should be ok to me. Anyone know what's up? --Mark
428 */
424 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL); 429 pixbuf = gdk_pixbuf_new_from_file(theme->icon, NULL);
425 430
426 gtk_list_store_set(smiley_theme_store, &iter, 431 gtk_list_store_set(smiley_theme_store, &iter,
427 0, pixbuf, 432 0, pixbuf,
428 1, description, 433 1, description,
450 #ifndef _WIN32 455 #ifndef _WIN32
451 gchar *command; 456 gchar *command;
452 #endif 457 #endif
453 gchar *destdir; 458 gchar *destdir;
454 gchar *tail; 459 gchar *tail;
460 GtkTreePath *themepath = NULL;
455 461
456 /* Just to be safe */ 462 /* Just to be safe */
457 g_strchomp(path); 463 g_strchomp(path);
458 464
459 /* I dont know what you are, get out of here */ 465 /* I dont know what you are, get out of here */
487 493
488 g_free(command); 494 g_free(command);
489 #endif 495 #endif
490 g_free(destdir); 496 g_free(destdir);
491 497
492 theme_refresh_theme_list(); 498 themepath = theme_refresh_theme_list();
499 if (themepath != NULL)
500 gtk_tree_path_free(themepath);
493 } 501 }
494 502
495 static void 503 static void
496 theme_got_url(void *data, const char *themedata, size_t len) 504 theme_got_url(void *data, const char *themedata, size_t len)
497 { 505 {