1
0
Fork 0

source/Platform/Unix/X11Display.cpp: in destroy() make sure m_disp is valid before calling functions that needs it.

This commit is contained in:
Henrik Hautakoski 2020-10-27 18:50:33 +01:00
parent 0d029817fe
commit 50439a58bd

View file

@ -78,12 +78,13 @@ bool X11Display::create(DisplayDescription description)
void X11Display::destroy()
{
if (m_win) {
X11WindowEventHandler::unregisterHandler(m_disp, m_win);
::XDestroyWindow(m_disp, m_win);
}
if (m_disp) {
if (m_win) {
X11WindowEventHandler::unregisterHandler(m_disp, m_win);
::XDestroyWindow(m_disp, m_win);
}
XReleaseDisplay(m_disp);
m_disp = NULL;
}