diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl.cpp | 5 | ||||
-rw-r--r-- | src/opengl/qgl.h | 3 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qglframebufferobject.h | 2 | ||||
-rw-r--r-- | src/opengl/qglpaintdevice_qws.cpp | 2 | ||||
-rw-r--r-- | src/opengl/qglpaintdevice_qws_p.h | 3 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer.h | 2 | ||||
-rw-r--r-- | src/opengl/qpaintengine_opengl.cpp | 2 |
9 files changed, 9 insertions, 12 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index ca5c732..cd7a7f0 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1484,8 +1484,8 @@ Q_OPENGL_EXPORT QGLShareRegister* qgl_share_reg() */ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device) + : d_ptr(new QGLContextPrivate(this)) { - d_ptr = new QGLContextPrivate(this); Q_D(QGLContext); d->init(device, format); } @@ -1507,8 +1507,8 @@ QGLContext::QGLContext(const QGLFormat &format, QPaintDevice *device) \sa format(), isValid() */ QGLContext::QGLContext(const QGLFormat &format) + : d_ptr(new QGLContextPrivate(this)) { - d_ptr = new QGLContextPrivate(this); Q_D(QGLContext); d->init(0, format); } @@ -1539,7 +1539,6 @@ QGLContext::~QGLContext() QGLSignalProxy::instance()->emitAboutToDestroyContext(this); reset(); - delete d; } void QGLContextPrivate::cleanup() diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 01b1d6f..b7b2f36 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -45,6 +45,7 @@ #include <QtGui/qwidget.h> #include <QtOpenGL/qglcolormap.h> #include <QtCore/qmap.h> +#include <QtCore/qscopedpointer.h> QT_BEGIN_HEADER @@ -348,7 +349,7 @@ protected: static QGLContext* currentCtx; private: - QGLContextPrivate* d_ptr; + QScopedPointer<QGLContextPrivate> d_ptr; friend class QGLPixelBuffer; friend class QGLPixelBufferPrivate; diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index c362b7e..6e908e2 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -448,7 +448,6 @@ QGLFramebufferObject::~QGLFramebufferObject() glDeleteRenderbuffersEXT(1, &d->depth_stencil_buffer); glDeleteFramebuffersEXT(1, &d->fbo); } - delete d_ptr; } /*! diff --git a/src/opengl/qglframebufferobject.h b/src/opengl/qglframebufferobject.h index a9e1b2f..fea8920 100644 --- a/src/opengl/qglframebufferobject.h +++ b/src/opengl/qglframebufferobject.h @@ -116,7 +116,7 @@ protected: private: Q_DISABLE_COPY(QGLFramebufferObject) - QGLFramebufferObjectPrivate *d_ptr; + QScopedPointer<QGLFramebufferObjectPrivate> d_ptr; friend class QGLDrawable; }; diff --git a/src/opengl/qglpaintdevice_qws.cpp b/src/opengl/qglpaintdevice_qws.cpp index 18905ab..60a1238 100644 --- a/src/opengl/qglpaintdevice_qws.cpp +++ b/src/opengl/qglpaintdevice_qws.cpp @@ -68,8 +68,6 @@ QWSGLPaintDevice::QWSGLPaintDevice(QWidget *widget) : QWSGLPaintDevice::~QWSGLPaintDevice() { - Q_D(QWSGLPaintDevice); - delete d; } QPaintEngine* QWSGLPaintDevice::paintEngine() const diff --git a/src/opengl/qglpaintdevice_qws_p.h b/src/opengl/qglpaintdevice_qws_p.h index 369de7f..a471b1b 100644 --- a/src/opengl/qglpaintdevice_qws_p.h +++ b/src/opengl/qglpaintdevice_qws_p.h @@ -53,6 +53,7 @@ // We mean it. // +#include <QtCore/qscopedpointer.h> #include <QPaintDevice> QT_BEGIN_NAMESPACE @@ -76,7 +77,7 @@ public: private: friend class QWSGLWindowSurface; - QWSGLPaintDevicePrivate *d_ptr; + QScopedPointer<QWSGLPaintDevicePrivate> d_ptr; }; diff --git a/src/opengl/qglpixelbuffer.cpp b/src/opengl/qglpixelbuffer.cpp index 5f74f26..8ff2e1d 100644 --- a/src/opengl/qglpixelbuffer.cpp +++ b/src/opengl/qglpixelbuffer.cpp @@ -186,7 +186,6 @@ QGLPixelBuffer::~QGLPixelBuffer() delete d->qctx; if (current && current != d->qctx) current->makeCurrent(); - delete d_ptr; } /*! \fn bool QGLPixelBuffer::makeCurrent() diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h index 0131570..8264c22 100644 --- a/src/opengl/qglpixelbuffer.h +++ b/src/opengl/qglpixelbuffer.h @@ -107,7 +107,7 @@ protected: private: Q_DISABLE_COPY(QGLPixelBuffer) - QGLPixelBufferPrivate *d_ptr; + QScopedPointer<QGLPixelBufferPrivate> d_ptr; friend class QGLDrawable; friend class QGLWindowSurface; }; diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 5a212f5..c9fbc7e 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -5625,7 +5625,7 @@ void QOpenGLPaintEngine::fill(const QVectorPath &path, const QBrush &brush) QPainter *p = painter(); QBrush oldBrush = p->brush(); p->setBrush(brush); - qt_draw_helper(p->d_ptr, painterPathFromVectorPath(path), QPainterPrivate::FillDraw); + qt_draw_helper(p->d_ptr.data(), painterPathFromVectorPath(path), QPainterPrivate::FillDraw); p->setBrush(oldBrush); return; } |