From: Yann Bodson Date: Mon, 28 May 2012 23:48:25 +0000 (+1000) Subject: Remove unnecessary temporary variable X-Git-Tag: 071012131707~279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1634d6b3c8aaf51e3a37f5a4a7bf2b72df38a5f6;p=profile%2Fivi%2Fqtdeclarative.git Remove unnecessary temporary variable Change-Id: Icec38fb08d6dc31fb6d0d86ec280fbb4557d5b67 Reviewed-by: Michael Brasser --- diff --git a/src/quick/util/qquickstyledtext.cpp b/src/quick/util/qquickstyledtext.cpp index 8462166..18f8e84 100644 --- a/src/quick/util/qquickstyledtext.cpp +++ b/src/quick/util/qquickstyledtext.cpp @@ -681,10 +681,12 @@ void QQuickStyledTextPrivate::parseImageAttributes(const QChar *&ch, const QStri // to avoid a relayout later on. QUrl url = baseUrl.resolved(image->url); if (url.isLocalFile()) { - QQuickPixmap *pix = new QQuickPixmap(context->engine(), url, image->size); - if (pix && pix->isReady()) { - image->size = pix->implicitSize(); - image->pix = pix; + image->pix = new QQuickPixmap(context->engine(), url, image->size); + if (image->pix && image->pix->isReady()) { + image->size = image->pix->implicitSize(); + } else { + delete image->pix; + image->pix = 0; } } }