qulogic/pidgin

merge of '632684df193628df0797be78cee966e1cf14db79'
release-2.2.1
2007-09-28, Luke Schierer
97611efca8c6
merge of '632684df193628df0797be78cee966e1cf14db79'
and 'e2fe53088dc1f540557aa8754c26d5fae36dcabf'
--- a/libpurple/dnssrv.c Tue Sep 18 20:30:25 2007 +0000
+++ b/libpurple/dnssrv.c Fri Sep 28 16:24:37 2007 +0000
@@ -69,6 +69,7 @@
char *error_message;
GSList *results;
#else
+ int fd_in, fd_out;
pid_t pid;
#endif
};
@@ -112,8 +113,11 @@
purple_restore_default_signal_handlers();
#endif
- if (read(in, query, 256) <= 0)
+ if (read(in, query, 256) <= 0) {
+ close(out);
+ close(in);
_exit(0);
+ }
size = res_query( query, C_IN, T_SRV, (u_char*)&answer, sizeof( answer));
@@ -179,6 +183,9 @@
ret = g_list_remove(ret, ret->data);
}
+ close(out);
+ close(in);
+
_exit(0);
}
@@ -358,6 +365,8 @@
query_data->cb = cb;
query_data->extradata = extradata;
query_data->pid = pid;
+ query_data->fd_out = out[0];
+ query_data->fd_in = in[1];
query_data->handle = purple_input_add(out[0], PURPLE_INPUT_READ, resolved, query_data);
g_free(query);
@@ -414,6 +423,9 @@
}
g_free(query_data->query);
g_free(query_data->error_message);
+#else
+ close(query_data->fd_out);
+ close(query_data->fd_in);
#endif
g_free(query_data);
}
--- a/libpurple/ft.c Tue Sep 18 20:30:25 2007 +0000
+++ b/libpurple/ft.c Fri Sep 28 16:24:37 2007 +0000
@@ -67,6 +67,7 @@
xfer->ui_ops = purple_xfers_get_ui_ops();
xfer->message = NULL;
xfer->current_buffer_size = FT_INITIAL_BUFFER_SIZE;
+ xfer->fd = -1;
ui_ops = purple_xfer_get_ui_ops(xfer);
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Tue Sep 18 20:30:25 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Sep 28 16:24:37 2007 +0000
@@ -281,13 +281,9 @@
}
}
} else {
- /* TODO: Using xfer->fd like this is probably a bad thing... */
+ xfer->fd = -1;
if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port,
- yahoo_receivefile_connected, xfer) == NULL)
- xfer->fd = -1;
- else
- xfer->fd = 0;
- if (xfer->fd == -1) {
+ yahoo_receivefile_connected, xfer) == NULL) {
purple_notify_error(gc, NULL, _("File Transfer Failed"),
_("Unable to establish file descriptor."));
purple_xfer_cancel_remote(xfer);
--- a/libpurple/upnp.c Tue Sep 18 20:30:25 2007 +0000
+++ b/libpurple/upnp.c Fri Sep 28 16:24:37 2007 +0000
@@ -553,7 +553,7 @@
dd->inpa = 0;
close(dd->fd);
- dd->fd = 0;
+ dd->fd = -1;
/* parse the response, and see if it was a success */
purple_upnp_parse_discover_response(buf, len, dd);
--- a/libpurple/util.c Tue Sep 18 20:30:25 2007 +0000
+++ b/libpurple/util.c Fri Sep 28 16:24:37 2007 +0000
@@ -3870,6 +3870,7 @@
gfud->full = full;
gfud->request = g_strdup(request);
gfud->include_headers = include_headers;
+ gfud->fd = -1;
purple_url_parse(url, &gfud->website.address, &gfud->website.port,
&gfud->website.page, &gfud->website.user, &gfud->website.passwd);
--- a/pidgin/gtkimhtml.c Tue Sep 18 20:30:25 2007 +0000
+++ b/pidgin/gtkimhtml.c Fri Sep 28 16:24:37 2007 +0000
@@ -3211,24 +3211,25 @@
im_image = data;
/* Update the pointer to this GdkPixbuf frame of the animation */
- g_object_unref(G_OBJECT(im_image->pixbuf));
- gdk_pixbuf_animation_iter_advance(GTK_IMHTML_ANIMATION(im_image)->iter, NULL);
- im_image->pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
- g_object_ref(G_OBJECT(im_image->pixbuf));
-
- /* Update the displayed GtkImage */
- width = gdk_pixbuf_get_width(gtk_image_get_pixbuf(im_image->image));
- height = gdk_pixbuf_get_height(gtk_image_get_pixbuf(im_image->image));
- if (width > 0 && height > 0)
- {
- /* Need to scale the new frame to the same size as the old frame */
- GdkPixbuf *tmp;
- tmp = gdk_pixbuf_scale_simple(im_image->pixbuf, width, height, GDK_INTERP_BILINEAR);
- gtk_image_set_from_pixbuf(im_image->image, tmp);
- g_object_unref(G_OBJECT(tmp));
- } else {
- /* Display at full-size */
- gtk_image_set_from_pixbuf(im_image->image, im_image->pixbuf);
+ if (gdk_pixbuf_animation_iter_advance(GTK_IMHTML_ANIMATION(im_image)->iter, NULL)) {
+ GdkPixbuf *pb = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
+ g_object_unref(G_OBJECT(im_image->pixbuf));
+ im_image->pixbuf = gdk_pixbuf_copy(pb);
+
+ /* Update the displayed GtkImage */
+ width = gdk_pixbuf_get_width(gtk_image_get_pixbuf(im_image->image));
+ height = gdk_pixbuf_get_height(gtk_image_get_pixbuf(im_image->image));
+ if (width > 0 && height > 0)
+ {
+ /* Need to scale the new frame to the same size as the old frame */
+ GdkPixbuf *tmp;
+ tmp = gdk_pixbuf_scale_simple(im_image->pixbuf, width, height, GDK_INTERP_BILINEAR);
+ gtk_image_set_from_pixbuf(im_image->image, tmp);
+ g_object_unref(G_OBJECT(tmp));
+ } else {
+ /* Display at full-size */
+ gtk_image_set_from_pixbuf(im_image->image, im_image->pixbuf);
+ }
}
delay = MIN(gdk_pixbuf_animation_iter_get_delay_time(GTK_IMHTML_ANIMATION(im_image)->iter), 100);
@@ -3249,11 +3250,14 @@
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;
GTK_IMHTML_ANIMATION(im_image)->iter = gdk_pixbuf_animation_get_iter(anim, NULL);
- im_image->pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
+ pb = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
+ im_image->pixbuf = gdk_pixbuf_copy(pb);
delay = MIN(gdk_pixbuf_animation_iter_get_delay_time(GTK_IMHTML_ANIMATION(im_image)->iter), 100);
GTK_IMHTML_ANIMATION(im_image)->timer = g_timeout_add(delay, animate_image_cb, im_image);
}
@@ -3266,7 +3270,6 @@
im_image->filesel = NULL;
g_object_ref(anim);
- g_object_ref(im_image->pixbuf);
return GTK_IMHTML_SCALABLE(im_image);
}
@@ -4606,10 +4609,15 @@
if (imhtml->num_animations == 20) {
GtkImage *image = GTK_IMAGE(g_queue_pop_head(imhtml->animations));
GdkPixbufAnimation *anim = gtk_image_get_animation(image);
+ g_signal_handlers_disconnect_matched(G_OBJECT(image), G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL, G_CALLBACK(animated_smiley_destroy_cb), NULL);
if (anim) {
GdkPixbuf *pb = gdk_pixbuf_animation_get_static_image(anim);
- gtk_image_set_from_pixbuf(image, pb);
- g_object_unref(G_OBJECT(pb));
+ if (pb != NULL) {
+ GdkPixbuf *copy = gdk_pixbuf_copy(pb);
+ gtk_image_set_from_pixbuf(image, copy);
+ g_object_unref(G_OBJECT(copy));
+ }
}
} else {
imhtml->num_animations++;