Re: Leak in nautilus-main.c



On Wed, 2005-01-26 at 14:58 +0100, Kjartan Maraas wrote:

> 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?

Not always, only if info != NULL. but otherwise that sounds right.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a scrappy devious grifter on the wrong side of the law. She's an 
enchanted mutant cab driver trying to make a difference in a man's world. They 
fight crime! 




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