[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.4.0-20080127-98-g199743d)
The branch, master has been updated
via 199743d5ae8e89fa4065e544d998ebaeab1c1cd6 (commit)
from eaa61c6968d3e17d0525cc476bf4c6d54ebd494d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
libgeda/src/o_picture.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
=================
Commit Messages
=================
commit 199743d5ae8e89fa4065e544d998ebaeab1c1cd6
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sun Jun 15 09:51:17 2008 +0200
libgeda: fix memory leak introduced with the last commit.
The function g_path_get_basename returns a newly allocated string.
This string has to be freed after usage. Thanks to Peter C. for the
hint.
:100644 100644 9641459... c404dfb... M libgeda/src/o_picture.c
=========
Changes
=========
commit 199743d5ae8e89fa4065e544d998ebaeab1c1cd6
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sun Jun 15 09:51:17 2008 +0200
libgeda: fix memory leak introduced with the last commit.
The function g_path_get_basename returns a newly allocated string.
This string has to be freed after usage. Thanks to Peter C. for the
hint.
diff --git a/libgeda/src/o_picture.c b/libgeda/src/o_picture.c
index 9641459..c404dfb 100644
--- a/libgeda/src/o_picture.c
+++ b/libgeda/src/o_picture.c
@@ -916,6 +916,7 @@ void o_picture_embed (TOPLEVEL *toplevel, OBJECT *object)
{
GError *err = NULL;
GdkPixbuf *pixbuf;
+ gchar *filename;
/* Free any existing embedded data */
g_free (object->picture->file_content);
@@ -952,8 +953,9 @@ void o_picture_embed (TOPLEVEL *toplevel, OBJECT *object)
object->picture->original_picture = pixbuf;
- s_log_message (_("Picture [%s] has been embedded\n"),
- g_path_get_basename(object->picture->filename));
+ filename = g_path_get_basename(object->picture->filename);
+ s_log_message (_("Picture [%s] has been embedded\n"), filename);
+ g_free(filename);
}
@@ -970,6 +972,7 @@ void o_picture_unembed (TOPLEVEL *toplevel, OBJECT *object)
{
GError *err = NULL;
GdkPixbuf *pixbuf;
+ gchar *filename;
pixbuf = gdk_pixbuf_new_from_file (object->picture->filename, &err);
if (err != NULL) {
@@ -990,8 +993,9 @@ void o_picture_unembed (TOPLEVEL *toplevel, OBJECT *object)
object->picture->file_length = 0;
object->picture->embedded = 0;
- s_log_message (_("Picture [%s] has been unembedded\n"),
- g_path_get_basename(object->picture->filename));
+ filename = g_path_get_basename(object->picture->filename);
+ s_log_message (_("Picture [%s] has been unembedded\n"), filename);
+ g_free(filename);
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs