summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-01-21 11:33:51 -0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-03 11:31:38 +0000
commit41830b812e5883ff7b98fa1f5779df4648738829 (patch)
treeb41cf28612c13ebb97d17a5a93aefe8e68ce4532 /src
parentb9f9357c27714acc23257c726b886539f49c0988 (diff)
QJsonObject::take: add missing detach() call
We were modifying shared objects. Fixes: QTBUG-89625 Change-Id: Id6bc735b79cf4beb9454fffd165c56476a5dec04 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 00b759a8d06dbec42232b1b8748c0725da7ced00) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/serialization/qjsonobject.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/serialization/qjsonobject.cpp b/src/corelib/serialization/qjsonobject.cpp
index fcac647784..fa26011159 100644
--- a/src/corelib/serialization/qjsonobject.cpp
+++ b/src/corelib/serialization/qjsonobject.cpp
@@ -634,6 +634,7 @@ QJsonValue QJsonObject::takeImpl(T key)
if (!keyExists)
return QJsonValue(QJsonValue::Undefined);
+ detach();
const QJsonValue v = QJsonPrivate::Value::fromTrustedCbor(o->extractAt(index + 1));
removeAt(index / 2);
return v;