Add checks for opengl context switch upon cleanup


Check if making current context switch is successful
before performing cleanup.

Fixes: QTBUG-128460
Pick-to: 6.8 6.5
Change-Id: Ic15f8fa451370f951dd51103a4bd8b5e41cf80d5
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
commit5e83def8faf6ccb51d2a9b333f6c2636cca9dc57
parent2d3e4b6fb8bc95b0197cd348dd41333ebacb8ef2
authorSakaria Pouke <sakaria.pouke@qt.io>
committerSakaria Pouke <sakaria.pouke@qt.io>
commit timeMon, 28 Oct 2024 12:57:18 +0300