Cleaned up fix for #234.

XFree may not be passed NULL.  An invalid window handle will cause
_glfwGetWindowProperty to not return 1.
master
Camilla Berglund ago%!(EXTRA string=11 years)
parent 135ee0d93f
commit b3c461bd7e
  1. 8
      src/x11_init.c

@ -355,7 +355,8 @@ static void detectEWMH(void)
XA_WINDOW,
(unsigned char**) &windowFromRoot) != 1)
{
XFree(windowFromRoot);
if (windowFromRoot)
XFree(windowFromRoot);
return;
}
@ -369,13 +370,12 @@ static void detectEWMH(void)
(unsigned char**) &windowFromChild) != 1)
{
XFree(windowFromRoot);
XFree(windowFromChild);
if (windowFromChild)
XFree(windowFromChild);
return;
}
_glfwReleaseXErrorHandler();
if (_glfw.x11.errorCode != Success)
return;
// It should be the ID of that same child window
if (*windowFromRoot != *windowFromChild)

Loading…
Cancel
Save