Re: Leak in nautilus-main.c



On Wed, 2005-01-26 at 14:58 +0100, Kjartan Maraas wrote:
> Hi.
> 
> Valgrind suggests that nautilus-main.c leaks an icon_info structure
> around here:
> 
>                 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?

Yeah, that loop leaks info sometimes. Feel free to commit the fix you
mentioned.

Thanks,
Martin





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