diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-06-10 14:46:39 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-06-10 14:49:48 (GMT) |
commit | 747444c6776d948dad479e7b6f3564d0515d4e52 (patch) | |
tree | 9d1b1369b7dda2f034cf878b338720d7696d1ba8 | |
parent | 9eeec42f67e3e5c344d024eb28ac4f09d7c96c41 (diff) | |
download | Qt-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
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 4 |
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; |