Silent audio mixing fix; Xlib Vulkan destruction order fix

This commit is contained in:
Jack Andersen
2018-05-28 09:28:36 -10:00
parent d5ec7bcc1e
commit 3028e34b51
6 changed files with 53 additions and 23 deletions

View File

@@ -413,6 +413,14 @@ public:
~ApplicationXlib()
{
for (auto& p : m_windows)
if (auto w = p.second.lock())
w->_cleanup();
#if BOO_HAS_VULKAN
g_VulkanContext.destroyDevice();
#endif
if (m_fontset)
XFreeFontSet(m_xDisp, m_fontset);
if (m_xIM)
@@ -541,10 +549,6 @@ public:
if (clientThread.joinable())
clientThread.join();
#if BOO_HAS_VULKAN
g_VulkanContext.destroyDevice();
#endif
return clientReturn;
}

View File

@@ -1111,13 +1111,9 @@ public:
~WindowXlib()
{
XLockDisplay(m_xDisp);
m_gfxCtx->destroy();
XUnmapWindow(m_xDisp, m_windowId);
XDestroyWindow(m_xDisp, m_windowId);
XFreeColormap(m_xDisp, m_colormapId);
XUnlockDisplay(m_xDisp);
APP->_deletedWindow(this);
_cleanup();
if (APP)
APP->_deletedWindow(this);
}
void setCallback(IWindowCallback* cb)
@@ -2013,7 +2009,21 @@ public:
return false;
}
void _cleanup()
{
if (m_gfxCtx)
{
XLockDisplay(m_xDisp);
m_gfxCtx->destroy();
m_gfxCtx.reset();
XUnmapWindow(m_xDisp, m_windowId);
XDestroyWindow(m_xDisp, m_windowId);
XFreeColormap(m_xDisp, m_colormapId);
XUnlockDisplay(m_xDisp);
}
}
ETouchType getTouchType() const
{
return m_touchType;