From 747444c6776d948dad479e7b6f3564d0515d4e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 10 Jun 2009 16:46:39 +0200 Subject: 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 --- src/gui/painting/qpaintengine_raster.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- cgit v0.12