gthumb r2369 - in trunk: . libgthumb
- From: mjc svn gnome org
- To: svn-commits-list gnome org
- Subject: gthumb r2369 - in trunk: . libgthumb
- Date: Thu, 31 Jul 2008 20:09:03 +0000 (UTC)
Author: mjc
Date: Thu Jul 31 20:09:02 2008
New Revision: 2369
URL: http://svn.gnome.org/viewvc/gthumb?rev=2369&view=rev
Log:
2008-07-31 Michael J. Chudobiak <mjc svn gnome org>
* libgthumb/image-loader.c: (image_loader_set_pixbuf):
When setting a static pixbuf, free any loaded animation
as animations override static pixbufs.
* libgthumb/image-viewer-image.c: (image_viewer_image_paint):
Remove unused variable.
* libgthumb/image-viewer.c: (set_pixbuf__step2),
(image_viewer_set_pixbuf):
Fix a potential race-condition if called while still
loading an image.
Patch by Geoffrey Antos <dynamotwain aim com>. Bug #501512.
Modified:
trunk/ChangeLog
trunk/libgthumb/image-loader.c
trunk/libgthumb/image-viewer-image.c
trunk/libgthumb/image-viewer.c
Modified: trunk/libgthumb/image-loader.c
==============================================================================
--- trunk/libgthumb/image-loader.c (original)
+++ trunk/libgthumb/image-loader.c Thu Jul 31 20:09:02 2008
@@ -417,6 +417,10 @@
g_return_if_fail (pixbuf != NULL);
g_mutex_lock (il->priv->data_mutex);
+ if (il->priv->animation != NULL) {
+ g_object_unref (il->priv->animation);
+ il->priv->animation = NULL;
+ }
if (il->priv->pixbuf != NULL) {
g_object_unref (il->priv->pixbuf);
il->priv->pixbuf = NULL;
Modified: trunk/libgthumb/image-viewer-image.c
==============================================================================
--- trunk/libgthumb/image-viewer-image.c (original)
+++ trunk/libgthumb/image-viewer-image.c Thu Jul 31 20:09:02 2008
@@ -1011,7 +1011,6 @@
cairo_t *cr)
{
ImageViewerImagePrivate *priv;
- GdkPixbuf *pixbuf;
GtkStyle *style;
gint border, border2;
@@ -1027,7 +1026,6 @@
g_return_if_fail (image != NULL);
priv = IMAGE_VIEWER_IMAGE_GET_PRIVATE (image);
- pixbuf = image_viewer_image_get_pixbuf (image);
style = GTK_WIDGET (priv->viewer)->style;
if (image_viewer_is_frame_visible (priv->viewer)) {
Modified: trunk/libgthumb/image-viewer.c
==============================================================================
--- trunk/libgthumb/image-viewer.c (original)
+++ trunk/libgthumb/image-viewer.c Thu Jul 31 20:09:02 2008
@@ -1354,19 +1354,42 @@
}
+static void
+set_pixbuf__step2 (ImageViewerLoadData *ivl_data)
+{
+ ImageViewerPrivate *priv = IMAGE_VIEWER_GET_PRIVATE (ivl_data->viewer);
+ GdkPixbuf *pixbuf = ivl_data->data;
+
+ image_loader_set_file (priv->loader, NULL);
+ image_loader_set_pixbuf (priv->loader, pixbuf);
+ image_loaded (priv->loader, ivl_data->viewer);
+
+ g_object_unref (G_OBJECT (pixbuf));
+ g_free (ivl_data);
+
+}
+
+
void
image_viewer_set_pixbuf (ImageViewer *viewer,
GdkPixbuf *pixbuf)
{
- ImageViewerPrivate* priv;
+ ImageViewerPrivate *priv;
+ ImageViewerLoadData *ivl_data;
g_return_if_fail (viewer != NULL);
priv = IMAGE_VIEWER_GET_PRIVATE (viewer);
- image_loader_set_pixbuf (priv->loader, pixbuf);
+ ivl_data = g_new0 (ImageViewerLoadData, 1);
+ ivl_data->viewer = viewer;
+ ivl_data->data = pixbuf;
+ g_object_ref (G_OBJECT (pixbuf));
+
+ image_loader_stop (priv->loader,
+ (DoneFunc) set_pixbuf__step2,
+ ivl_data);
- image_loaded (priv->loader, viewer);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]