[Xfce4-commits] <ristretto:master> plug memory-leak

Stephan Arts noreply at xfce.org
Mon Nov 28 22:06:01 CET 2011


Updating branch refs/heads/master
         to ed60d6427e912f393e97de4b09f447efa781e601 (commit)
       from 5330ef9c6143e2c8a7ad17e03793038e1f9c4a0f (commit)

commit ed60d6427e912f393e97de4b09f447efa781e601
Author: Stephan Arts <stephan at xfce.org>
Date:   Mon Nov 28 22:02:53 2011 +0100

    plug memory-leak

 src/main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/main.c b/src/main.c
index f550a44..69f4b8d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -198,7 +198,8 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
 
                     if (strncmp (content_type, "image/", 6) == 0)
                     {
-                        if (rstto_image_list_add_file (rof->image_list, rstto_file_new(file), NULL) == TRUE)
+                        r_file = rstto_file_new (file);
+                        if (rstto_image_list_add_file (rof->image_list, r_file, NULL) == TRUE)
                         {
                             rstto_main_window_add_file_to_recent_files (file);
                         }
@@ -231,6 +232,7 @@ cb_rstto_open_files (RsttoOpenFiles *rof)
                     /* TODO: show error dialog */
                 }
             }
+            g_object_unref (file);
         }
 
         if (file_type != G_FILE_TYPE_DIRECTORY && r_file != NULL)


More information about the Xfce4-commits mailing list