[gthumb: 21/40] slideshow: copy the static image to avoid a crash



commit 34a46b0ba52024c8c66924ff8f781294c9652b97
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Sep 8 21:30:17 2010 +0200

    slideshow: copy the static image to avoid a crash

 extensions/slideshow/gth-slideshow.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/extensions/slideshow/gth-slideshow.c b/extensions/slideshow/gth-slideshow.c
index 8e75a9e..8a9f29d 100644
--- a/extensions/slideshow/gth-slideshow.c
+++ b/extensions/slideshow/gth-slideshow.c
@@ -234,6 +234,7 @@ image_preloader_requested_ready_cb (GthImagePreloader  *preloader,
 				    gpointer            user_data)
 {
 	GthSlideshow *self = user_data;
+	GdkPixbuf    *static_image;
 
 	if (error != NULL) {
 		g_clear_error (&error);
@@ -242,7 +243,13 @@ image_preloader_requested_ready_cb (GthImagePreloader  *preloader,
 	}
 
 	_g_object_unref (self->priv->current_pixbuf);
-	self->priv->current_pixbuf = gdk_pixbuf_animation_get_static_image (animation);
+
+	static_image = gdk_pixbuf_animation_get_static_image (animation);
+	if (static_image != NULL)
+		self->priv->current_pixbuf = gdk_pixbuf_copy (static_image);
+	else
+		self->priv->current_pixbuf = NULL;
+
 	if (self->priv->current_pixbuf == NULL) {
 		_gth_slideshow_load_next_image (self);
 		return;



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