From 1ba6875372bbe13b7df90a6cd1d547c628b47cd0 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 24 Feb 2010 14:34:00 +0100 Subject: Avoid always detaching QStaticText As a left over from when the d pointer was a plain pointer and not a QExplicitlySharedPointer, we were setting the reference count to 1 on construction. Since QExplicitlySharedPointer handles the ref count, a newly constructed QStaticText would have a ref count of 2, and thus would always detach upon modification. Reviewed-by: Gunnar --- src/gui/text/qstatictext.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index 952d998..8fe4c47 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -350,7 +350,6 @@ QStaticTextPrivate::QStaticTextPrivate() : items(0), itemCount(0), glyphPool(0), positionPool(0), needsClipRect(false), useBackendOptimizations(false), textFormat(Qt::AutoText) { - ref = 1; } QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other) @@ -358,7 +357,6 @@ QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other) items(0), itemCount(0), glyphPool(0), positionPool(0), needsClipRect(false), useBackendOptimizations(other.useBackendOptimizations), textFormat(other.textFormat) { - ref = 1; } QStaticTextPrivate::~QStaticTextPrivate() -- cgit v0.12