summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-10 14:46:39 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-06-10 14:49:48 (GMT)
commit747444c6776d948dad479e7b6f3564d0515d4e52 (patch)
tree9d1b1369b7dda2f034cf878b338720d7696d1ba8 /src/gui/painting
parent9eeec42f67e3e5c344d024eb28ac4f09d7c96c41 (diff)
downloadQt-747444c6776d948dad479e7b6f3564d0515d4e52.zip
Qt-747444c6776d948dad479e7b6f3564d0515d4e52.tar.gz
Qt-747444c6776d948dad479e7b6f3564d0515d4e52.tar.bz2
Fixed memory leak in raster paint engine.
Unlike the span array, the clip line array is only free'd in the destructor, so if it's already allocated we shouldn't allocate it again. Reviewed-by: Denis Dzyubenko
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 2ce1d09..4711455 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4332,7 +4332,9 @@ void QClipData::initialize()
if (m_spans)
return;
- m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
+ if (!m_clipLines)
+ m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
+
m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
allocated = clipSpanHeight;