summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopenglwindow.cpp
diff options
context:
space:
mode:
authorEven Oscar Andersen <even.oscar.andersen@qt.io>2024-07-02 16:41:33 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-07-19 13:42:20 +0000
commit52c9346f5bf2c7d59be84f5286418cc76f2334eb (patch)
tree65266d37f5e6c253292d2178ec63ec6d6e7b59be /src/opengl/qopenglwindow.cpp
parentfe284006b23337805c7d0d9d53401cff978a327d (diff)
Move destruction logic to QOpenGLWindow from Private
QOpenGLWindow has been destroyed when QOpenGLWindowPrivate destructor runs Fixes: QTBUG-126845 Change-Id: I4f0208c4adf1a875cdcaca91fc239cf4e6200e4d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit c337cdf39cc249560bf9a5380e308d09a4c13b95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/opengl/qopenglwindow.cpp')
-rw-r--r--src/opengl/qopenglwindow.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/opengl/qopenglwindow.cpp b/src/opengl/qopenglwindow.cpp
index a3677aa828b..6b74aaedd70 100644
--- a/src/opengl/qopenglwindow.cpp
+++ b/src/opengl/qopenglwindow.cpp
@@ -188,14 +188,6 @@ public:
QOpenGLWindowPrivate::~QOpenGLWindowPrivate()
{
- Q_Q(QOpenGLWindow);
- if (q->isValid()) {
- q->makeCurrent(); // this works even when the platformwindow is destroyed
- paintDevice.reset(nullptr);
- fbo.reset(nullptr);
- blitter.destroy();
- q->doneCurrent();
- }
}
void QOpenGLWindowPrivate::initialize()
@@ -367,7 +359,15 @@ QOpenGLWindow::QOpenGLWindow(QOpenGLContext *shareContext, UpdateBehavior update
*/
QOpenGLWindow::~QOpenGLWindow()
{
- makeCurrent();
+ Q_D(QOpenGLWindow);
+
+ makeCurrent(); // this works even when the platformwindow is destroyed
+ if (isValid()) {
+ d->paintDevice.reset(nullptr);
+ d->fbo.reset(nullptr);
+ d->blitter.destroy();
+ }
+ doneCurrent();
}
/*!