gnome-control-center r9143 - in trunk: . font-viewer
- From: rodrigo svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-control-center r9143 - in trunk: . font-viewer
- Date: Tue, 18 Nov 2008 17:59:38 +0000 (UTC)
Author: rodrigo
Date: Tue Nov 18 17:59:38 2008
New Revision: 9143
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=9143&view=rev
Log:
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.
Modified:
trunk/ChangeLog
trunk/font-viewer/font-view.c
trunk/font-viewer/ftstream-vfs.c
Modified: trunk/font-viewer/font-view.c
==============================================================================
--- trunk/font-viewer/font-view.c (original)
+++ trunk/font-viewer/font-view.c Tue Nov 18 17:59:38 2008
@@ -385,8 +385,10 @@
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 @@
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
Modified: trunk/font-viewer/ftstream-vfs.c
==============================================================================
--- trunk/font-viewer/ftstream-vfs.c (original)
+++ trunk/font-viewer/ftstream-vfs.c Tue Nov 18 17:59:38 2008
@@ -68,10 +68,10 @@
vfs_stream_open(FT_Stream stream,
const char *uri)
{
- GFile *file = NULL;
+ GFile *file;
GError *error = NULL;
- GFileInfo *info = NULL;
- GFileInputStream *handle = NULL;
+ GFileInfo *info;
+ GFileInputStream *handle;
if (!stream)
return FT_Err_Invalid_Stream_Handle;
@@ -81,6 +81,7 @@
handle = g_file_read (file, NULL, &error);
if (! handle) {
g_message (error->message);
+ g_object_unref (file);
g_error_free (error);
return FT_Err_Cannot_Open_Resource;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]