summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-12-13 11:02:30 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-12-13 11:02:30 (GMT)
commit33f1cc91fad5915cb732ed371288147fb82157f8 (patch)
tree5625a2fa73ffeb994f3c00581f8bc971651d9616 /src/gui/painting
parent443f2df750ac01b3c598d833d5c067798c1e670d (diff)
downloadQt-33f1cc91fad5915cb732ed371288147fb82157f8.zip
Qt-33f1cc91fad5915cb732ed371288147fb82157f8.tar.gz
Qt-33f1cc91fad5915cb732ed371288147fb82157f8.tar.bz2
[blitter] Fix memory leak in the blitter paintengine
The raster engine and the capabilities were leaked, use the QScopedPointer to prevent that from happening. Cherry-picked-from: qtbase:d5f12b898b8480c891382c54672422c50218751a. Change-Id: I31ba0117280b48ad942fbb638fb151ccb7b34385 Merge-request: 1492 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_blitter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp
index 75efa20..69f0301 100644
--- a/src/gui/painting/qpaintengine_blitter.cpp
+++ b/src/gui/painting/qpaintengine_blitter.cpp
@@ -198,8 +198,8 @@ public:
hasXForm(false)
{
- raster = new QRasterPaintEngine(p->buffer());
- capabillities = new CapabilitiesToStateMask(pmData->blittable()->capabilities());
+ raster.reset(new QRasterPaintEngine(p->buffer()));
+ capabillities.reset(new CapabilitiesToStateMask(pmData->blittable()->capabilities()));
}
inline void lock() {
@@ -279,12 +279,12 @@ public:
raster->d_func()->systemStateChanged();
}
- QRasterPaintEngine *raster;
+ QScopedPointer<QRasterPaintEngine> raster;
QBlittablePixmapData *pmData;
bool isBlitterLocked;
- CapabilitiesToStateMask *capabillities;
+ QScopedPointer<CapabilitiesToStateMask> capabillities;
uint hasXForm;
};
@@ -655,7 +655,7 @@ void QBlitterPaintEngine::setState(QPainterState *s)
inline QRasterPaintEngine *QBlitterPaintEngine::raster() const
{
Q_D(const QBlitterPaintEngine);
- return d->raster;
+ return d->raster.data();
}
QT_END_NAMESPACE