summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontmetrics.h
diff options
context:
space:
mode:
authorAndreas Kling <info@andreaskling.com>2009-10-27 18:58:10 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-10-27 19:12:15 (GMT)
commitb209ab1e2139cb50e26bbeeb094da9a6a4a8a067 (patch)
tree46d524717f1a99923f7b714441724a398ef19b34 /src/gui/text/qfontmetrics.h
parent588b1c40115b975ad4998251646f00db23144cd4 (diff)
downloadQt-b209ab1e2139cb50e26bbeeb094da9a6a4a8a067.zip
Qt-b209ab1e2139cb50e26bbeeb094da9a6a4a8a067.tar.gz
Qt-b209ab1e2139cb50e26bbeeb094da9a6a4a8a067.tar.bz2
Always use QExplicitlySharedDataPointer<QFontPrivate>
Fixes a refcount bug that occurs when QFont is constructed from a QFontPrivate* that was created without an initial ref(). Merge-request: 1831 Reviewed-by: Olivier Goffart <ogoffart@trolltech.com>
Diffstat (limited to 'src/gui/text/qfontmetrics.h')
-rw-r--r--src/gui/text/qfontmetrics.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h
index 1147e3a..23200c5 100644
--- a/src/gui/text/qfontmetrics.h
+++ b/src/gui/text/qfontmetrics.h
@@ -43,6 +43,7 @@
#define QFONTMETRICS_H
#include <QtGui/qfont.h>
+#include <QtCore/qsharedpointer.h>
#ifndef QT_INCLUDE_COMPAT
#include <QtCore/qrect.h>
#endif
@@ -131,7 +132,7 @@ private:
friend class QFontMetricsF;
friend class QStackTextEngine;
- QFontPrivate *d;
+ QExplicitlySharedDataPointer<QFontPrivate> d;
};
@@ -187,7 +188,7 @@ public:
inline bool operator !=(const QFontMetricsF &other) const { return !operator==(other); }
private:
- QFontPrivate *d;
+ QExplicitlySharedDataPointer<QFontPrivate> d;
};
QT_END_NAMESPACE