changeset 38345:3238db7bdfef

(Fx_create_frame): Initialize frame colors to -1, for the case that x_decode_colors signals an error.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 10 Jul 2001 12:19:10 +0000
parents f70837a465ac
children a86234ceb517
files src/xfns.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Tue Jul 10 10:46:53 2001 +0000
+++ b/src/xfns.c	Tue Jul 10 12:19:10 2001 +0000
@@ -4182,6 +4182,16 @@
   {
     Lisp_Object black;
     struct gcpro gcpro1;
+
+    /* Function x_decode_color can signal an error.  Make
+       sure to initialize color slots so that we won't try
+       to free colors we haven't allocated.  */
+    f->output_data.x->foreground_pixel = -1;
+    f->output_data.x->background_pixel = -1;
+    f->output_data.x->cursor_pixel = -1;
+    f->output_data.x->cursor_foreground_pixel = -1;
+    f->output_data.x->border_pixel = -1;
+    f->output_data.x->mouse_pixel = -1;
     
     black = build_string ("black");
     GCPRO1 (black);