diff options
-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; } |