[sushi] font-loader: plug some memory leaks



commit 7d8d94931819c618c07bb490e0f63d9cc3b8667f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue May 1 14:25:11 2012 -0400

    font-loader: plug some memory leaks

 src/libsushi/sushi-font-loader.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libsushi/sushi-font-loader.c b/src/libsushi/sushi-font-loader.c
index d599a57..3168892 100644
--- a/src/libsushi/sushi-font-loader.c
+++ b/src/libsushi/sushi-font-loader.c
@@ -156,16 +156,20 @@ sushi_new_ft_face_from_uri (FT_Library library,
                             GError **error)
 {
   FontLoadJob *job = NULL;
+  FT_Face face;
 
   job = font_load_job_new (library, uri, NULL, NULL);
   font_load_job_do_load (job, error);
 
   if ((error != NULL) && (*error != NULL)) {
-    g_object_unref (job);
+    font_load_job_free (job);
     return NULL;
   }
 
-  return create_face_from_contents (job, contents, error);
+  face = create_face_from_contents (job, contents, error);
+  font_load_job_free (job);
+
+  return face;
 }
 
 /**



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