I suspect at shutdown, the "QScreen" backing the qquickwindow is deleted before the qquickwindow is closed - when that happens, qt still has gl resources it wants to release, so tries to acquire a new shared gl context and release them, before shutting down properly.
But this causes qtmir to try creating a new QPlatformOpenGLContext which tries to create a Display, while mir is shutting down, and I suspect the egl state is not suited to that.
Proper solution is to implement a QPlatformOffscreenSurface and use it on shutdown
I suspect at shutdown, the "QScreen" backing the qquickwindow is deleted before the qquickwindow is closed - when that happens, qt still has gl resources it wants to release, so tries to acquire a new shared gl context and release them, before shutting down properly.
But this causes qtmir to try creating a new QPlatformOpenGL Context which tries to create a Display, while mir is shutting down, and I suspect the egl state is not suited to that.
Proper solution is to implement a QPlatformOffscr eenSurface and use it on shutdown