Leak in nautilus-main.c



Hi.

Valgrind suggests that nautilus-main.c leaks an icon_info structure
around here:

==5824== 576 bytes in 12 blocks are definitely lost in loss record 99 of 133
==5824==    at 0x1B904BA9: calloc (vg_replace_malloc.c:175)
==5824==    by 0x1C3FEA6B: IA__g_malloc0 (gmem.c:154)
==5824==    by 0x1BDA56C1: icon_info_new (gtkicontheme.c:2259)
==5824==    by 0x1BDA7D76: IA__gtk_icon_theme_lookup_icon (gtkicontheme.c:1890)
==5824==    by 0x8074727: main (nautilus-main.c:160)

The code is:

                for (j = 0; j < G_N_ELEMENTS(sizes); j++) {
                        info = gtk_icon_theme_lookup_icon (icon_theme, icons_to_register[i], sizes[j].pixel, 0);

                        if (info != NULL &&
                            (sizes[j].gtk == 0 ||
                             gtk_icon_info_get_base_size (info) == sizes[j].pixel)) {
                                icon = gtk_icon_info_get_filename (info);
                                gtk_icon_source_set_filename (source, icon);
                                if (sizes[j].gtk == 0) {
                                        gtk_icon_source_set_size (source, 0);
                                        gtk_icon_source_set_size_wildcarded (source, TRUE);
                                } else {
                                        gtk_icon_source_set_size (source, sizes[j].gtk);
                                        gtk_icon_source_set_size_wildcarded (source, FALSE);
                                }
                                gtk_icon_set_add_source (set, source);
                                gtk_icon_info_free (info);
                        }
                }

Could it be that the condition is stopping the icon_info from being
free'd and that the call to gtk_icon_info_free() should be moved out one
level so that it's called always?

Cheers
Kjartan





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]