changeset 10574:77ef3f2f0df8

[gaim-migrate @ 11966] Leak fixes, round 3. Also, fix find in the log viewer to find in all logs, not just every-other-one-you-select. Plus some other minor tweaks. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 05 Feb 2005 17:59:20 +0000
parents 2d809781816f
children 96307e1a47c9
files plugins/autorecon.c plugins/docklet/docklet-x11.c src/gtkimhtml.c src/gtklog.c src/gtkmain.c src/gtksavedstatuses.c src/protocols/msn/object.c src/protocols/oscar/oscar.c
diffstat 8 files changed, 31 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/autorecon.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/plugins/autorecon.c	Sat Feb 05 17:59:20 2005 +0000
@@ -187,7 +187,11 @@
 reconnected(GaimConnection *gc, void *m) {
 	GaimAccount *account;
 
-	g_return_if_fail(gc != NULL && accountReconnecting != NULL);
+	g_return_if_fail(gc != NULL);
+
+	if (accountReconnecting == NULL)
+		return;
+
 	account = gaim_connection_get_account(gc);
 
 	accountReconnecting = g_slist_remove(accountReconnecting, account);
--- a/plugins/docklet/docklet-x11.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/plugins/docklet/docklet-x11.c	Sat Feb 05 17:59:20 2005 +0000
@@ -173,8 +173,6 @@
 		g_object_unref(G_OBJECT(blank_icon));
 	blank_icon = NULL;
 
-	if (image)
-		gtk_widget_destroy(image);
 	image = NULL;
 
 	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "destroyed\n");
--- a/src/gtkimhtml.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/src/gtkimhtml.c	Sat Feb 05 17:59:20 2005 +0000
@@ -946,6 +946,8 @@
 	g_slist_free(imhtml->im_images);
 	if (imhtml->protocol_name)
 		g_free(imhtml->protocol_name);
+	if (imhtml->search_string)
+		g_free(imhtml->search_string);
 	G_OBJECT_CLASS(parent_class)->finalize (object);
 }
 
@@ -3080,6 +3082,7 @@
 		gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter,
 						 gtk_text_buffer_get_mark(imhtml->text_buffer, "search"));
 	}
+	g_free(imhtml->search_string);
 	imhtml->search_string = g_strdup(text);
 
 	if (gtk_source_iter_forward_search(&iter, imhtml->search_string,
--- a/src/gtklog.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/src/gtklog.c	Sat Feb 05 17:59:20 2005 +0000
@@ -105,6 +105,7 @@
 					   0, title,
 					   1, log, -1);
 		}
+		g_free(read);
 	}
 
 
@@ -189,12 +190,15 @@
 	title = title_utf8;
 	gtk_window_set_title(GTK_WINDOW(viewer->window), title);
 	gtk_imhtml_clear(GTK_IMHTML(viewer->imhtml));
-       	gtk_imhtml_append_text(GTK_IMHTML(viewer->imhtml), read,
+	gtk_imhtml_append_text(GTK_IMHTML(viewer->imhtml), read,
 			       GTK_IMHTML_NO_COMMENTS | GTK_IMHTML_NO_TITLE | GTK_IMHTML_NO_SCROLL |
 			       ((flags & GAIM_LOG_READ_NO_NEWLINE) ? GTK_IMHTML_NO_NEWLINE : 0));
 
 	if (viewer->search)
+	{
+		gtk_imhtml_search_clear(GTK_IMHTML(viewer->imhtml));
 		gtk_imhtml_search_find(GTK_IMHTML(viewer->imhtml), viewer->search);
+	}
 
 	g_free(read);
 	g_free(title);
@@ -225,6 +229,7 @@
 		/* do utf8 conversions */
 		utf8_tmp = gaim_utf8_try_convert(month);
 		strncpy(month, utf8_tmp, sizeof(month));
+		g_free(utf8_tmp);
 		utf8_tmp = gaim_utf8_try_convert(title);
 		strncpy(title, utf8_tmp, sizeof(title));
 		g_free(utf8_tmp);
--- a/src/gtkmain.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/src/gtkmain.c	Sat Feb 05 17:59:20 2005 +0000
@@ -54,6 +54,7 @@
 #include "gtkprivacy.h"
 #include "gtkrequest.h"
 #include "gtkroomlist.h"
+#include "gtksavedstatuses.h"
 #include "gtksound.h"
 #include "gtkutils.h"
 #include "gtkstock.h"
@@ -258,6 +259,7 @@
 	gaim_gtk_prefs_init();
 	gaim_gtk_account_init();
 	gaim_gtk_blist_init();
+	gaim_gtk_status_init();
 	gaim_gtk_conversations_init();
 	gaim_gtk_pounces_init();
 	gaim_gtk_privacy_init();
@@ -282,6 +284,12 @@
 	/* Save the plugins we have loaded for next time. */
 	gaim_gtk_plugins_save();
 
+	/* Uninit */
+	gaim_gtk_conversations_uninit();
+	gaim_gtk_status_uninit();
+	gaim_gtk_blist_uninit();
+	gaim_gtk_account_uninit();
+
 	/* and end it all... */
 	gtk_main_quit();
 }
--- a/src/gtksavedstatuses.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/src/gtksavedstatuses.c	Sat Feb 05 17:59:20 2005 +0000
@@ -480,8 +480,9 @@
 static gboolean
 status_editor_destroy_cb(GtkWidget *widget, GdkEvent *event, gpointer user_data)
 {
-	StatusWindow *dialog = user_data;
+	StatusEditor *dialog = user_data;
 
+	g_free(dialog->original_title);
 	g_free(dialog);
 
 	return FALSE;
@@ -490,10 +491,11 @@
 static void
 status_editor_cancel_cb(GtkButton *button, gpointer user_data)
 {
-	StatusWindow *dialog = user_data;
+	StatusEditor *dialog = user_data;
 
 	gtk_widget_destroy(dialog->window);
 
+	g_free(dialog->original_title);
 	g_free(dialog);
 }
 
@@ -538,8 +540,6 @@
 		{
 			gtk_list_store_remove(status_window->model, &iter);
 		}
-
-		g_free(dialog->original_title);
 	}
 
 	status = gaim_savedstatus_new(title, type);
@@ -549,6 +549,7 @@
 	g_free(unformatted);
 
 	gtk_widget_destroy(dialog->window);
+	g_free(dialog->original_title);
 	g_free(dialog);
 
 	add_status_to_saved_status_list(status_window->model, status);
@@ -782,7 +783,7 @@
 	gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0);
 	gtk_widget_show(frame);
 
-	if (status != NULL)
+	if ((status != NULL) && (gaim_savedstatus_get_message(status) != NULL))
 		gtk_imhtml_append_text(GTK_IMHTML(text),
 							   gaim_savedstatus_get_message(status), 0);
 
--- a/src/protocols/msn/object.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/src/protocols/msn/object.c	Sat Feb 05 17:59:20 2005 +0000
@@ -110,6 +110,9 @@
 	if (obj->location != NULL)
 		g_free(obj->location);
 
+	if (obj->real_location != NULL)
+		g_free(obj->real_location);
+
 	if (obj->friendly != NULL)
 		g_free(obj->friendly);
 
--- a/src/protocols/oscar/oscar.c	Fri Feb 04 23:42:33 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Feb 05 17:59:20 2005 +0000
@@ -67,8 +67,6 @@
 
 #define FAIM_DEBUG_LEVEL 0
 
-static GaimPlugin *my_protocol = NULL;
-
 static int caps_aim = AIM_CAPS_CHAT | AIM_CAPS_BUDDYICON | AIM_CAPS_DIRECTIM | AIM_CAPS_SENDFILE | AIM_CAPS_INTEROPERATE | AIM_CAPS_ICHAT;
 static int caps_icq = AIM_CAPS_BUDDYICON | AIM_CAPS_DIRECTIM | AIM_CAPS_SENDFILE | AIM_CAPS_ICQUTF8 | AIM_CAPS_INTEROPERATE | AIM_CAPS_ICHAT;
 
@@ -7728,13 +7726,6 @@
 	option = gaim_account_option_string_new(_("Encoding"), "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
-	/* We don't add these to protocol_options because they're ICQ specific */
-	option = gaim_account_option_bool_new(_("Authorization"), "authorization", OSCAR_DEFAULT_AUTHORIZATION);
-	option = gaim_account_option_bool_new(_("Hide IP"), "hide_ip", OSCAR_DEFAULT_HIDE_IP);
-	option = gaim_account_option_bool_new(_("Web presence"), "web_aware", OSCAR_DEFAULT_WEB_AWARE);
-
-	my_protocol = plugin;
-
 	gaim_prefs_add_none("/plugins/prpl/oscar");
 	gaim_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE);
 	gaim_prefs_add_bool("/plugins/prpl/oscar/show_idle", FALSE);