changeset 5970:730015652f4d

[gaim-migrate @ 6417] Fixes one of those GDK warning things. Happened when clicking cancel on select font dialog for conversations. Problem was gtk_widget_destroy was getting called twice for gtkconv->dialogs.font, second time being passed NULL. This font stuff is ugly, IMHO. Like, look at show_font_dialog. Yeesh. No code re-use whatsoever. That function should either be split up or made to suck less. One of gai'ms young aspiring actors should take care of that. Aren't there always people that are like, "I want to code something but don't know what to do?!??" Well there you go. I also changed a bit o' proxy.c code in an attempt to fix KimuSan^'s problem. I'm not really sure what his problem is, but I have a strong feeling that the lines I changed are better the way they are now. If I'm wrong, someone should probably correct me. But if I'm right... we'll lets just say we'll all be a whole lot thinner. "And somebody get this walking carpet out of my way." "No reward is worth this." committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 28 Jun 2003 17:15:23 +0000
parents 4b1d6ed1204f
children 0878caaef952
files src/dialogs.c src/proxy.c
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Sat Jun 28 08:51:44 2003 +0000
+++ b/src/dialogs.c	Sat Jun 28 17:15:23 2003 +0000
@@ -3124,9 +3124,11 @@
 			GTK_TOGGLE_BUTTON(gtkconv->toolbar.font), FALSE);
 	}
 
-	dialogwindows = g_list_remove(dialogwindows, gtkconv->dialogs.font);
-	gtk_widget_destroy(gtkconv->dialogs.font);
-	gtkconv->dialogs.font = NULL;
+	if (gtkconv->dialogs.font) {
+		dialogwindows = g_list_remove(dialogwindows, gtkconv->dialogs.font);
+		gtk_widget_destroy(gtkconv->dialogs.font);
+		gtkconv->dialogs.font = NULL;
+	}
 }
 
 void apply_font(GtkWidget *widget, GtkFontSelection *fontsel)
--- a/src/proxy.c	Sat Jun 28 08:51:44 2003 +0000
+++ b/src/proxy.c	Sat Jun 28 17:15:23 2003 +0000
@@ -737,15 +737,15 @@
 	struct PHB *phb = data;
 	unsigned int len;
 	int error=0;
-	int ret=0;
 
 	gaim_debug(GAIM_DEBUG_INFO, "proxy", "Connected.\n");
 
 	len = sizeof(error);
 
-	ret = getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len);
-	if (ret < 0 || error != 0) {
-		if(ret==0) errno = error;
+	if (getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len) < 0) {
+/*	if (ret < 0 || error != 0) { */
+		/* The fourth parameter above isn't really "error", is it? */
+		/* if(ret==0) errno = error; */
 		close(source);
 		gaim_input_remove(phb->inpa);