diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-11-16 02:51:19 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-11-16 02:51:19 +0000 |
commit | 4f9db59bfd813196e49b3d0beae51d2fe84f46ec (patch) | |
tree | f85b8bca98e13c01fc6e8204e70c431ab41da317 /gdk-pixbuf/gdk-pixbuf-animation.c | |
parent | d651bb25cd53dd8dee940fe9d788d0c7d9e0dc18 (diff) | |
download | gtk+-4f9db59bfd813196e49b3d0beae51d2fe84f46ec.tar.gz |
Be extra careful when locking and handle the case that the module may
2004-11-15 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-animation.c:
* gdk-pixbuf-loader.c:
* gdk-pixbuf-io.c: Be extra careful when locking and handle
the case that the module may initialize the thread system.
* gdk-pixbuf-io.[hc] (_gdk_pixbuf_lock): Return whether the
lock was actually taken.
Diffstat (limited to 'gdk-pixbuf/gdk-pixbuf-animation.c')
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-animation.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index fa6968c153..56e5864e92 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -137,6 +137,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename, guchar buffer [128]; GdkPixbufModule *image_module; gchar *display_name; + gboolean locked; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); @@ -181,7 +182,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename, return NULL; } - _gdk_pixbuf_lock (image_module); + locked = _gdk_pixbuf_lock (image_module); if (image_module->load_animation == NULL) { GdkPixbuf *pixbuf; @@ -245,7 +246,8 @@ gdk_pixbuf_animation_new_from_file (const char *filename, g_free (display_name); out_unlock: - _gdk_pixbuf_unlock (image_module); + if (locked) + _gdk_pixbuf_unlock (image_module); return animation; } |