[cheese/wip/hans-fixes: 34/35] cheese: Fix assert failures when taking a photo



commit 2da9f39d442c97158d0858c998e03993207d9ec1
Author: Hans de Goede <hdegoede redhat com>
Date:   Thu Jun 13 11:37:19 2013 +0200

    cheese: Fix assert failures when taking a photo
    
    Before this patch, cheese would log the following each time the user takes
    a photo:
    
    (cheese:21719): GLib-GIO-CRITICAL **: g_file_info_get_size: assertion `G_IS_FILE_INFO (info)' failed
    
    (cheese:21719): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
    
    Signed-off-by: Hans de Goede <hdegoede redhat com>

 src/thumbview/cheese-thumb-view.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index c229b1a..a702fc0 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -205,6 +205,13 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
 
   info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE, 0, NULL,
                             NULL);
+  if (!info)
+  {
+    /* This is normal since photos first get created with a tmpname, ie:
+     * "2013-06-13-113155.jpg.DQRGYW" and then moved to their final name,
+     * we will get another append_item call for the final name. */
+    return;
+  }
   size = g_file_info_get_size (info);
   g_object_unref (info);
 


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