Mercurial > emacs
changeset 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 | d554a3ac3039 |
children | 14c579655073 |
files | src/w32xfns.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
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; }