Fix crash after Qt.quit on Arm Mali GPU


There is an issue on Mali that keeps a pointer to the old wl_surface
which was current before, and when we make the new surface current it
tries to access it, even it have already destroyed it at that point.
The issue is reported here:

https://community.arm.com/support-forums/f/graphics-gaming-and-vr-forum/8146/r12p0-wayland-driver-odroid-xu3-frees-objects-too-early-leading-to-segm-fault/36417

Avoid the crash by calling eglMakeCurrent(EGL_NO_SURFACE) before
wl_surface destroy as the workaround for Mali GPU only.

Pick-to: 6.5 6.7 6.8
Fixes: QTBUG-127980
Change-Id: I900de9ce0f8ee32a7148f54c9aa53d36dc5d9bec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commit125af88b2c498a57bce2135a806cf940904afe86
parentbd3cdc5c1f76ae3a9558ab60e08c628781ceb16e
authorJiu Shanheng <shanheng.jiu@qt.io>
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
commit timeThu, 19 Sep 2024 14:27:07 +0200