[Xfce4-commits] r22284 - xfburn/trunk/xfburn

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Thu Jul 6 18:15:01 CEST 2006


Jean-François Wauthy wrote:
> +#ifdef HAVE_THUNAR_VFS
> +	  GdkScreen *screen;
> +	  GtkIconTheme *icon_theme;
> +	  ThunarVfsMimeDatabase *mime_database = NULL;
> +	  ThunarVfsMimeInfo *mime_info = NULL;
> +	  const gchar *mime_icon_name = NULL;
> +	  GdkPixbuf *mime_icon = NULL;
> +	  
> +	  screen = gtk_widget_get_screen (GTK_WIDGET (dc));
> +	  icon_theme = gtk_icon_theme_get_for_screen (screen);
> +	  
> +	  mime_database = thunar_vfs_mime_database_get_default ();
> +	  mime_info = thunar_vfs_mime_database_get_info_for_file (mime_database, path, NULL);
> +		
> +	  mime_icon_name = thunar_vfs_mime_info_lookup_icon_name (mime_info, icon_theme);
> +	  mime_icon = gtk_icon_theme_load_icon (icon_theme, mime_icon_name, 24, 0, NULL);
> +#endif

You're leaking memory here: thunar_vfs_mime_database_get_default() takes
a reference for the caller, so you should probably call
g_object_unref(). And thunar_vfs_mime_database_get_info_for_file() takes
a reference that should be freed using thunar_vfs_mime_info_unref().

HTH,
Benedikt



More information about the Xfce4-dev mailing list