Avoid crashes when a theme is loaded with one frame suspended
* src/xfaces.c (load_color2, Fcolor_distance): Don't try to call the frame's defined_color_hook if the frame is suspended. (Bug#43886)
This commit is contained in:
parent
0407b15500
commit
3196fd44c3
1 changed files with 10 additions and 0 deletions
10
src/xfaces.c
10
src/xfaces.c
|
@ -1059,6 +1059,13 @@ static unsigned long
|
||||||
load_color2 (struct frame *f, struct face *face, Lisp_Object name,
|
load_color2 (struct frame *f, struct face *face, Lisp_Object name,
|
||||||
enum lface_attribute_index target_index, Emacs_Color *color)
|
enum lface_attribute_index target_index, Emacs_Color *color)
|
||||||
{
|
{
|
||||||
|
if (FRAME_TERMINAL (f)->defined_color_hook == NULL)
|
||||||
|
{
|
||||||
|
Lisp_Object frame;
|
||||||
|
XSETFRAME (frame, f);
|
||||||
|
signal_error ("Unable to load colors for suspended TTY frame", frame);
|
||||||
|
}
|
||||||
|
|
||||||
eassert (STRINGP (name));
|
eassert (STRINGP (name));
|
||||||
eassert (target_index == LFACE_FOREGROUND_INDEX
|
eassert (target_index == LFACE_FOREGROUND_INDEX
|
||||||
|| target_index == LFACE_BACKGROUND_INDEX
|
|| target_index == LFACE_BACKGROUND_INDEX
|
||||||
|
@ -4391,6 +4398,9 @@ two lists of the form (RED GREEN BLUE) aforementioned. */)
|
||||||
struct frame *f = decode_live_frame (frame);
|
struct frame *f = decode_live_frame (frame);
|
||||||
Emacs_Color cdef1, cdef2;
|
Emacs_Color cdef1, cdef2;
|
||||||
|
|
||||||
|
if (FRAME_TERMINAL (f)->defined_color_hook == NULL)
|
||||||
|
signal_error ("Unable to validate colors for suspended TTY frame", frame);
|
||||||
|
|
||||||
if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
|
if (!(CONSP (color1) && parse_rgb_list (color1, &cdef1))
|
||||||
&& !(STRINGP (color1)
|
&& !(STRINGP (color1)
|
||||||
&& FRAME_TERMINAL (f)->defined_color_hook (f,
|
&& FRAME_TERMINAL (f)->defined_color_hook (f,
|
||||||
|
|
Loading…
Add table
Reference in a new issue