Mercurial > emacs
diff src/w32xfns.c @ 34094:59adbaee3092
(get_frame_dc): Avoid changing the palette on an invalid frame.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Fri, 01 Dec 2000 20:06:39 +0000 |
parents | f390b90e3495 |
children | 9c0d7d896682 |
line wrap: on
line diff
--- a/src/w32xfns.c Fri Dec 01 19:47:36 2000 +0000 +++ b/src/w32xfns.c Fri Dec 01 20:06:39 2000 +0000 @@ -117,7 +117,11 @@ enter_crit (); hdc = GetDC (f->output_data.w32->window_desc); - select_palette (f, hdc); + + /* If this gets called during startup before the frame is valid, + there is a chance of corrupting random data or crashing. */ + if (hdc) + select_palette (f, hdc); return hdc; }