Fix one more crash on context loss.
This commit is contained in:
parent
d81997194e
commit
29cfdad44c
1 changed files with 3 additions and 0 deletions
|
|
@ -91,6 +91,9 @@ void SurfaceOpenGL::paintEvent(QPaintEvent *e) {
|
|||
return;
|
||||
}
|
||||
engine->begin(device);
|
||||
if (!isValid()) { // The call above could lose the context.
|
||||
return;
|
||||
}
|
||||
const auto f = context()->functions();
|
||||
if (const auto bg = _renderer->clearColor()) {
|
||||
f->glClearColor(bg->redF(), bg->greenF(), bg->blueF(), bg->alphaF());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue