[gnome-screenshot] screenshot: always unlink the temporary file from the shell



commit 567d7586591108e4c48e0de6b1f137c18313d791
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jan 25 13:47:57 2012 -0500

    screenshot: always unlink the temporary file from the shell
    
    Even if we fail to load it.

 src/screenshot-utils.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/screenshot-utils.c b/src/screenshot-utils.c
index 523e19e..24a31dc 100644
--- a/src/screenshot-utils.c
+++ b/src/screenshot-utils.c
@@ -630,6 +630,9 @@ screenshot_get_pixbuf (GdkWindow    *window,
     {
       screenshot = gdk_pixbuf_new_from_file (filename, &error);
 
+      /* remove the temporary file created by the shell */
+      g_unlink (filename);
+
       if (error != NULL)
         {
           g_warning ("Unable to load GNOME Shell's builtin screenshot result, "
@@ -638,11 +641,6 @@ screenshot_get_pixbuf (GdkWindow    *window,
 
           screenshot = screenshot_get_pixbuf_fallback (window, rectangle);
         }
-      else
-        {
-          /* remove the temporary file created by the shell */
-          g_unlink (filename);
-        }
     }
 
   g_free (path);



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