diff options
author | Eskil Abrahamsen Blomfeldt <eblomfel@trolltech.com> | 2009-06-30 14:26:54 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-01-14 12:48:02 (GMT) |
commit | 30245b9fcfadaa7b400993aff05f8d1a54bea8d8 (patch) | |
tree | eb39862f72d88dee89825ed1b61ce3c2fea04cb3 /src/gui/text/qstatictext.cpp | |
parent | 99d9f3c14ecebe72a2d10016b37d9a309f7a8c13 (diff) | |
download | Qt-30245b9fcfadaa7b400993aff05f8d1a54bea8d8.zip Qt-30245b9fcfadaa7b400993aff05f8d1a54bea8d8.tar.gz Qt-30245b9fcfadaa7b400993aff05f8d1a54bea8d8.tar.bz2 |
Fix memory leak
Diffstat (limited to 'src/gui/text/qstatictext.cpp')
-rw-r--r-- | src/gui/text/qstatictext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp index b6c123b..f953d71 100644 --- a/src/gui/text/qstatictext.cpp +++ b/src/gui/text/qstatictext.cpp @@ -133,7 +133,7 @@ QStaticText::QStaticText(const QStaticText &other) Destroys the QStaticText. */ QStaticText::~QStaticText() -{ +{ if (!d_ptr->ref.deref()) delete d_ptr; } @@ -261,10 +261,12 @@ QString QStaticText::toString() const QStaticTextPrivate::QStaticTextPrivate() : textLayout(new QTextLayout()) { + ref = 1; } QStaticTextPrivate::QStaticTextPrivate(const QStaticTextPrivate &other) { + ref = 1; textLayout = new QTextLayout(other.textLayout->text(), other.textLayout->font()); size = other.size; } |