don't leak icon_name.
2008-11-18 Rodrigo Moya <rodrigo@gnome-db.org> * font-viewer/font-view.c (set_icon): don't leak icon_name. * font-viewer/ftstream-vfs.c (vfs_stream_open): don't leak GFile pointer. svn path=/trunk/; revision=9143
This commit is contained in:
parent
8cff6042ab
commit
afbe70bca0
3 changed files with 22 additions and 14 deletions
|
@ -385,8 +385,10 @@ set_icon(GtkWindow *window, const gchar *uri)
|
|||
|
||||
info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
|
||||
G_FILE_QUERY_INFO_NONE, NULL, NULL);
|
||||
if (! info)
|
||||
goto end;
|
||||
if (! info) {
|
||||
g_object_unref (file);
|
||||
return;
|
||||
}
|
||||
|
||||
content_type = g_file_info_get_content_type (info);
|
||||
icon = g_content_type_get_icon (content_type);
|
||||
|
@ -398,22 +400,20 @@ set_icon(GtkWindow *window, const gchar *uri)
|
|||
if (names) {
|
||||
gint i;
|
||||
for (i = 0; names[i]; i++)
|
||||
if (gtk_icon_theme_has_icon (icon_theme, names[i]))
|
||||
icon_name = g_strdup (names[i]);
|
||||
if (gtk_icon_theme_has_icon (icon_theme, names[i])) {
|
||||
icon_name = g_strdup (names[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (icon_name)
|
||||
if (icon_name) {
|
||||
gtk_window_set_icon_name (window, icon_name);
|
||||
g_free (icon_name);
|
||||
}
|
||||
|
||||
g_object_unref (icon);
|
||||
g_free (content_type);
|
||||
|
||||
end:
|
||||
if (icon_name)
|
||||
g_free(icon_name);
|
||||
|
||||
g_object_unref (file);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue