1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 00:01:33 -08:00

(x_real_positions): Handle failure in XQueryTree.

This commit is contained in:
Richard M. Stallman 2002-03-14 09:13:28 +00:00
parent 7c3f9166ee
commit e7161ad9ff

View file

@ -1176,13 +1176,19 @@ x_real_positions (f, xptr, yptr)
Window wm_window, rootw;
Window *tmp_children;
unsigned int tmp_nchildren;
int success;
XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
&wm_window, &tmp_children, &tmp_nchildren);
XFree ((char *) tmp_children);
success = XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
&wm_window, &tmp_children, &tmp_nchildren);
had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
/* Don't free tmp_children if XQueryTree failed. */
if (! success)
break;
XFree ((char *) tmp_children);
if (wm_window == rootw || had_errors)
break;