diff options
-rw-r--r-- | src/corelib/kernel/qcore_mac.cpp | 2 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp index 80cbac9..e45ef50 100644 --- a/src/corelib/kernel/qcore_mac.cpp +++ b/src/corelib/kernel/qcore_mac.cpp @@ -75,6 +75,8 @@ CFStringRef QCFString::toCFStringRef(const QString &string) QCFString::operator CFStringRef() const { if (!type) { + if (string.d->data != string.d->array) + const_cast<QCFString*>(this)->string.realloc(); // ### Qt5: do we really need this stupid user protection? const_cast<QCFString*>(this)->type = CFStringCreateWithCharactersNoCopy(0, reinterpret_cast<const UniChar *>(string.unicode()), diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index c61d09e..bf0a0ad 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -639,6 +639,7 @@ private: static Data *fromAscii_helper(const char *str, int size = -1); void replace_helper(uint *indices, int nIndices, int blen, const QChar *after, int alen); friend class QCharRef; + friend class QCFString; friend class QTextCodec; friend class QStringRef; friend struct QAbstractConcatenable; |