changeset 644:b3900e312d8e

[gaim-migrate @ 654] hopefully this will reduce pixmap leaks. we'll see though committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 08 Aug 2000 22:50:18 +0000
parents df1ceace5cac
children df03cd223ff9
files src/about.c src/aim.c src/buddy.c src/conversation.c src/dialogs.c src/util.c
diffstat 6 files changed, 39 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/about.c	Tue Aug 08 22:47:47 2000 +0000
+++ b/src/about.c	Tue Aug 08 22:50:18 2000 +0000
@@ -89,6 +89,7 @@
 		pixmap = gtk_pixmap_new(pm, bm);
 		gtk_box_pack_start(GTK_BOX(vbox), pixmap, TRUE, TRUE, 0);
 		gtk_widget_show(pixmap);
+		gdk_pixmap_unref(pm);
 		
 		label = gtk_label_new(
 "GAIM is a client that supports AOL's Instant Messenger protocol\nwritten under the GTK\n" 
--- a/src/aim.c	Tue Aug 08 22:47:47 2000 +0000
+++ b/src/aim.c	Tue Aug 08 22:50:18 2000 +0000
@@ -510,6 +510,7 @@
 	pmw = gtk_pixmap_new( pm, mask);
 	gtk_table_attach(GTK_TABLE(table), pmw, 0,2,0,1,0,0,5,5);
 	gtk_widget_show(pmw);
+	gdk_pixmap_unref(pm);
 #endif /* USE_APPLET */
 
         
--- a/src/buddy.c	Tue Aug 08 22:47:47 2000 +0000
+++ b/src/buddy.c	Tue Aug 08 22:50:18 2000 +0000
@@ -256,6 +256,7 @@
 						  NULL, xpm);
 		pic = gtk_pixmap_new(pm, bm);
 		gtk_widget_show(pic);
+		gdk_pixmap_unref(pm);
 		label = GTK_BIN(button)->child;
 		gtk_container_remove(GTK_CONTAINER(button), label);
 		gtk_container_add(GTK_CONTAINER(button), pic);
@@ -922,6 +923,7 @@
 	b->caps = 0;
 			
 	gtk_widget_show(b->pix);
+	gdk_pixmap_unref(pm);
 
 	b->label = gtk_label_new(buddy);
 	gtk_misc_set_alignment(GTK_MISC(b->label), 0.0, 0.5);
@@ -1586,12 +1588,14 @@
 			gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
                         if (display_options & OPT_DISP_SHOW_PIXMAPS)
 				gtk_widget_show(b->pix);
+			gdk_pixmap_unref(pm);
 
 			pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
 				NULL, (gchar **)login_icon_xpm);
 
         		if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				BuddyTickerAddUser( b->name, pm, bm );	
+			gdk_pixmap_unref(pm);
 
 			if (display_options & OPT_DISP_SHOW_LOGON) {
 				struct conversation *c = find_conversation(b->name);
@@ -1643,61 +1647,73 @@
                                 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)away_icon_xpm);
                                 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+				gdk_pixmap_unref(pm);
         			if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				{
 					pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)away_icon_xpm);
 					BuddyTickerSetPixmap(b->name, pm, bm);
+					gdk_pixmap_unref(pm);
 				}
                         } else if (b->uc & UC_AOL) {
                                 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)aol_icon_xpm);
                                 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+				gdk_pixmap_unref(pm);
         			if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				{
 					pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)aol_icon_xpm);
 					BuddyTickerSetPixmap(b->name, pm, bm);
+					gdk_pixmap_unref(pm);
 				}
                         } else if (b->uc & UC_NORMAL) {
                                 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)free_icon_xpm);
                                 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+				gdk_pixmap_unref(pm);
         			if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				{
 					pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)free_icon_xpm);
 					BuddyTickerSetPixmap(b->name, pm, bm);
+					gdk_pixmap_unref(pm);
 				}
                         } else if (b->uc & UC_ADMIN) {
                                 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)admin_icon_xpm);
                                 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+				gdk_pixmap_unref(pm);
         			if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				{
 					pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)admin_icon_xpm);
 					BuddyTickerSetPixmap(b->name, pm, bm);
+					gdk_pixmap_unref(pm);
 				}
                         } else if (b->uc & UC_UNCONFIRMED) {
                                 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)dt_icon_xpm);
                                 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+				gdk_pixmap_unref(pm);
         			if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				{
 					pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)dt_icon_xpm);
 					BuddyTickerSetPixmap(b->name, pm, bm);
+					gdk_pixmap_unref(pm);
 				}
                         } else {
                                 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)no_icon_xpm);
                                 gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+				gdk_pixmap_unref(pm);
         			if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				{
 					pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
                                                                   NULL, (gchar **)no_icon_xpm);
 					BuddyTickerSetPixmap(b->name, pm, bm);
+					gdk_pixmap_unref(pm);
 				}
                         }
                         if (display_options & OPT_DISP_SHOW_PIXMAPS)
@@ -1727,12 +1743,14 @@
 				NULL, (gchar **)logout_icon_xpm);
 			gtk_widget_hide(b->pix);
 			gtk_pixmap_set(GTK_PIXMAP(b->pix), pm, bm);
+                        if (display_options & OPT_DISP_SHOW_PIXMAPS)
+				gtk_widget_show(b->pix);
+			gdk_pixmap_unref(pm);
 			pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm,
 				NULL, (gchar **)logout_icon_xpm);
         		if ( ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER )
 				BuddyTickerSetPixmap( b->name, pm, bm );
-                        if (display_options & OPT_DISP_SHOW_PIXMAPS)
-				gtk_widget_show(b->pix);
+			gdk_pixmap_unref(pm);
 			if (display_options & OPT_DISP_SHOW_LOGON) {
 				struct conversation *c = find_conversation(b->name);
 				if (c) {
--- a/src/conversation.c	Tue Aug 08 22:47:47 2000 +0000
+++ b/src/conversation.c	Tue Aug 08 22:50:18 2000 +0000
@@ -1429,6 +1429,20 @@
 	}
 	
 	gtk_widget_show(toolbar);
+
+	gdk_pixmap_unref(link_i);
+	gdk_pixmap_unref(palette_i);
+	gdk_pixmap_unref(wood_i);
+	gdk_pixmap_unref(speaker_i);
+	gdk_pixmap_unref(strike_i);
+	gdk_pixmap_unref(bold_i);
+	gdk_pixmap_unref(italic_i);
+	gdk_pixmap_unref(underline_i);
+	gdk_pixmap_unref(small_i);
+	gdk_pixmap_unref(normal_i);
+	gdk_pixmap_unref(big_i);
+	gdk_pixmap_unref(font_i);
+	gdk_pixmap_unref(smiley_i);
 	
 	c->bold = bold;
 	c->strike = strike;
--- a/src/dialogs.c	Tue Aug 08 22:47:47 2000 +0000
+++ b/src/dialogs.c	Tue Aug 08 22:50:18 2000 +0000
@@ -2911,6 +2911,7 @@
 	dpm = gdk_pixmap_create_from_xpm_d(win->window, &mask, &win->style->white, xpm);
 	tpm = gtk_pixmap_new(dpm, mask);
 	gtk_widget_show(tpm);
+	gdk_pixmap_unref(dpm);
 	button = gtk_toolbar_append_element(GTK_TOOLBAR(bar), GTK_TOOLBAR_CHILD_BUTTON, NULL, NULL, NULL, NULL, tpm, GTK_SIGNAL_FUNC(set_smiley_array), (int *)face);
 	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(insert_smiley_text), c);
 
--- a/src/util.c	Tue Aug 08 22:47:47 2000 +0000
+++ b/src/util.c	Tue Aug 08 22:50:18 2000 +0000
@@ -928,6 +928,7 @@
 	gtk_widget_show(button_box_3);
 	gtk_widget_show(button_box);
 	gtk_widget_show(button);
+	gdk_pixmap_unref(pm);
 		
 	return button;
 }
@@ -962,6 +963,7 @@
 	gtk_widget_show(button_box_2);
 	gtk_widget_show(button_box);
 	gtk_widget_show(button);
+	gdk_pixmap_unref(pm);
 	
 	gtk_tooltips_set_tip(tips, button, text, "Gaim");	
 	return button;