GL/Context: Ensure context is destroyed before GBM device

Fixes crash on shutdown when running under DRM/KMS.
This commit is contained in:
Connor McLaughlin
2021-02-01 01:27:14 +10:00
parent 1a9120135f
commit dac9cdd04c
3 changed files with 33 additions and 5 deletions

View File

@ -21,6 +21,11 @@ ContextEGLGBM::~ContextEGLGBM()
Assert(!m_current_present_buffer);
#endif
// We have to destroy the context before the surface/device.
// Leaving it to the base class would be too late.
DestroySurface();
DestroyContext();
while (m_num_buffers > 0)
{
Buffer& buffer = m_buffers[--m_num_buffers];