summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qsettings_mac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qsettings_mac.cpp')
-rw-r--r--src/corelib/io/qsettings_mac.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp
index b79abfb874..0e3520441e 100644
--- a/src/corelib/io/qsettings_mac.cpp
+++ b/src/corelib/io/qsettings_mac.cpp
@@ -269,8 +269,10 @@ static QVariant qtValue(CFPropertyListRef cfvalue)
// Fast-path for QByteArray, so that we don't have to go
// though the expensive and lossy conversion via UTF-8.
- if (!byteArray.startsWith('@'))
+ if (!byteArray.startsWith('@')) {
+ byteArray.detach();
return byteArray;
+ }
const QString str = QString::fromUtf8(byteArray.constData(), byteArray.size());
return QSettingsPrivate::stringToVariant(str);