Fix Qt's texture use-after-free with HiDPI
This commit is contained in:
parent
a8b24e6f6f
commit
367a64aa1f
1 changed files with 1 additions and 8 deletions
|
|
@ -38,7 +38,6 @@ private:
|
||||||
const std::unique_ptr<Renderer> _renderer;
|
const std::unique_ptr<Renderer> _renderer;
|
||||||
QMetaObject::Connection _connection;
|
QMetaObject::Connection _connection;
|
||||||
QSize _deviceSize;
|
QSize _deviceSize;
|
||||||
bool _inPaintEvent = false;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -85,16 +84,10 @@ void SurfaceOpenGL::resizeGL(int w, int h) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceOpenGL::paintEvent(QPaintEvent *e) {
|
void SurfaceOpenGL::paintEvent(QPaintEvent *e) {
|
||||||
if (_inPaintEvent) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_inPaintEvent = true;
|
|
||||||
if (_deviceSize != size() * devicePixelRatio()) {
|
if (_deviceSize != size() * devicePixelRatio()) {
|
||||||
QResizeEvent event = { size(), size() };
|
QCoreApplication::postEvent(this, new QResizeEvent(size(), size()));
|
||||||
resizeEvent(&event);
|
|
||||||
}
|
}
|
||||||
QOpenGLWidget::paintEvent(e);
|
QOpenGLWidget::paintEvent(e);
|
||||||
_inPaintEvent = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceOpenGL::paintGL() {
|
void SurfaceOpenGL::paintGL() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue