pidgin: be715dc4: Fix animated icons that have been right-...
datallah at pidgin.im
datallah at pidgin.im
Tue Mar 25 22:40:43 EDT 2008
-----------------------------------------------------------------
Revision: be715dc48f96b78dd5c0c1fb94cacaa75487838b
Ancestor: 226af7101c9fd3ae43d1a19b9b6d3dcbad249828
Author: datallah at pidgin.im
Date: 2008-03-26T02:37:45
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/be715dc48f96b78dd5c0c1fb94cacaa75487838b
Modified files:
pidgin/gtkimhtml.c
ChangeLog:
Fix animated icons that have been right-clicked causing crashes when the imhtml is destroyed. Fixes #5217.
-------------- next part --------------
============================================================
--- pidgin/gtkimhtml.c 435f359601c21c5dff292ed9fe4d9649a9ee8a21
+++ pidgin/gtkimhtml.c 9778a210fbcab6624ed7cd12cb73deb85d3487e4
@@ -3296,7 +3296,7 @@ GtkIMHtmlScalable *gtk_imhtml_animation_
GtkIMHtmlScalable *gtk_imhtml_animation_new(GdkPixbufAnimation *anim, const gchar *filename, int id)
{
- GtkIMHtmlImage *im_image = g_malloc(sizeof(GtkIMHtmlAnimation));
+ GtkIMHtmlImage *im_image = (GtkIMHtmlImage *) g_new0(GtkIMHtmlAnimation, 1);
GTK_IMHTML_SCALABLE(im_image)->scale = gtk_imhtml_image_scale;
GTK_IMHTML_SCALABLE(im_image)->add_to = gtk_imhtml_image_add_to;
@@ -3304,10 +3304,8 @@ GtkIMHtmlScalable *gtk_imhtml_animation_
GTK_IMHTML_ANIMATION(im_image)->anim = anim;
if (gdk_pixbuf_animation_is_static_image(anim)) {
- GTK_IMHTML_ANIMATION(im_image)->iter = NULL;
im_image->pixbuf = gdk_pixbuf_animation_get_static_image(anim);
g_object_ref(im_image->pixbuf);
- GTK_IMHTML_ANIMATION(im_image)->timer = 0;
} else {
int delay;
GdkPixbuf *pb;
@@ -3320,10 +3318,8 @@ GtkIMHtmlScalable *gtk_imhtml_animation_
im_image->image = GTK_IMAGE(gtk_image_new_from_pixbuf(im_image->pixbuf));
im_image->width = gdk_pixbuf_animation_get_width(anim);
im_image->height = gdk_pixbuf_animation_get_height(anim);
- im_image->mark = NULL;
im_image->filename = g_strdup(filename);
im_image->id = id;
- im_image->filesel = NULL;
g_object_ref(anim);
@@ -3619,7 +3615,7 @@ static gboolean gtk_imhtml_smiley_clicke
image = gtk_imhtml_animation_new(anim, smiley->smile, 0);
ret = gtk_imhtml_image_clicked(w, event, (GtkIMHtmlImage*)image);
- g_object_set_data_full(G_OBJECT(w), "image-data", image, (GDestroyNotify)gtk_imhtml_image_free);
+ g_object_set_data_full(G_OBJECT(w), "image-data", image, (GDestroyNotify)gtk_imhtml_animation_free);
return ret;
}
More information about the Commits
mailing list