Commit 436bc8e0 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix bug #12025 with a crash when displaying tooltips.

 src/print.c (print_object): Don't crash when a frame's name is nil
 or invalid.
 src/window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
 it signals an error when a tooltip frame is being created.
parent dfce923a
2012-07-23 Eli Zaretskii <eliz@gnu.org>
* print.c (print_object): Don't crash when a frame's name is nil
or invalid. (Bug#12025)
* window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
it signals an error when a tooltip frame is being created.
2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
Cleanup miscellaneous objects allocation and initialization.
......
......@@ -1897,10 +1897,21 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag
else if (FRAMEP (obj))
{
int len;
Lisp_Object frame_name = XFRAME (obj)->name;
strout ((FRAME_LIVE_P (XFRAME (obj))
? "#<frame " : "#<dead frame "),
-1, -1, printcharfun);
print_string (XFRAME (obj)->name, printcharfun);
if (!STRINGP (frame_name))
{
/* A frame could be too young and have no name yet;
don't crash. */
if (SYMBOLP (frame_name))
frame_name = Fsymbol_name (frame_name);
else /* can't happen: name should be either nil or string */
frame_name = build_string ("*INVALID*FRAME*NAME*");
}
print_string (frame_name, printcharfun);
len = sprintf (buf, " %p", XFRAME (obj));
strout (buf, len, len, printcharfun);
PRINTCHAR ('>');
......
......@@ -151,7 +151,8 @@ decode_any_window (register Lisp_Object window)
CHECK_WINDOW (window);
w = XWINDOW (window);
CHECK_LIVE_FRAME (w->frame);
/* The following test throws up every time a tooltip frame is displayed. */
/* CHECK_LIVE_FRAME (w->frame); */
return w;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment