Index: libzvt//ChangeLog
===================================================================
RCS file: /cvs/gnome/libzvt/ChangeLog,v
retrieving revision 1.349
diff -p -u -5 -r1.349 ChangeLog
--- libzvt//ChangeLog	24 Jun 2002 15:15:23 -0000	1.349
+++ libzvt//ChangeLog	9 Sep 2002 07:32:47 -0000
@@ -1,5 +1,11 @@
+2002-09-09  Shivram U  <shivaram.upadhyayula@wipro.com>
+	* libzvt/zvtterm.c (zvt_term_set_color_scheme): free the colors 
+	allocated before allocating for the new color scheme.
+	find the red, green and blue values for the term's colormap, for the
+	color values passed before allocating the colors. Fixes #86540
+
 2002-06-24  jacob berkman  <jacob@ximian.com>
 
 	* configure.in: 2.0.1
 
 	* libzvt/Makefile.am (install-exec-local): add a dep to the
Index: libzvt//libzvt/zvtterm.c
===================================================================
RCS file: /cvs/gnome/libzvt/libzvt/zvtterm.c,v
retrieving revision 1.189
diff -p -u -5 -r1.189 zvtterm.c
--- libzvt//libzvt/zvtterm.c	19 Jun 2002 19:17:20 -0000	1.189
+++ libzvt//libzvt/zvtterm.c	9 Sep 2002 07:33:06 -0000
@@ -870,16 +870,27 @@ zvt_term_set_color_scheme (ZvtTerm *term
     clone_col(&zp->queue_blue, blu);
     return;
   }
   */
 
+  gdk_colormap_free_colors(term->color_map, term->colors, 18);
   memset (term->colors, 0, sizeof (term->colors));
 
   for(i=0;i<18;i++) {
-	term->colors[i].red=  red[i];
-	term->colors[i].green= grn[i];
-	term->colors[i].blue= blu[i];
+	GdkColor color;
+
+	color.red = red[i];
+	color.green = grn[i];
+	color.blue = blu[i];
+
+	gdk_rgb_find_color (term->color_map, &color);
+	gdk_colormap_query_color (term->color_map, color.pixel, &color);
+
+	term->colors[i].red= color.red;
+	term->colors[i].green= color.green;
+	term->colors[i].blue= color.blue;
+	term->colors[i].pixel= color.pixel;
   }
   gdk_colormap_alloc_colors(term->color_map, term->colors, 18, FALSE, TRUE, success);
 
   /* Deprecated */
   /*
