mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 09:01:46 +00:00
Cleaned up fix for #234.
XFree may not be passed NULL. An invalid window handle will cause _glfwGetWindowProperty to not return 1.
This commit is contained in:
parent
135ee0d93f
commit
b3c461bd7e
@ -355,6 +355,7 @@ static void detectEWMH(void)
|
|||||||
XA_WINDOW,
|
XA_WINDOW,
|
||||||
(unsigned char**) &windowFromRoot) != 1)
|
(unsigned char**) &windowFromRoot) != 1)
|
||||||
{
|
{
|
||||||
|
if (windowFromRoot)
|
||||||
XFree(windowFromRoot);
|
XFree(windowFromRoot);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -369,13 +370,12 @@ static void detectEWMH(void)
|
|||||||
(unsigned char**) &windowFromChild) != 1)
|
(unsigned char**) &windowFromChild) != 1)
|
||||||
{
|
{
|
||||||
XFree(windowFromRoot);
|
XFree(windowFromRoot);
|
||||||
|
if (windowFromChild)
|
||||||
XFree(windowFromChild);
|
XFree(windowFromChild);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_glfwReleaseXErrorHandler();
|
_glfwReleaseXErrorHandler();
|
||||||
if (_glfw.x11.errorCode != Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// It should be the ID of that same child window
|
// It should be the ID of that same child window
|
||||||
if (*windowFromRoot != *windowFromChild)
|
if (*windowFromRoot != *windowFromChild)
|
||||||
|
Loading…
Reference in New Issue
Block a user