Skip to content

Commit b272afa

Browse files
committed
removed the cloning of additonalData from PerformDeepClone
1 parent c2c2226 commit b272afa

File tree

1 file changed

+0
-23
lines changed
  • src/Umbraco.Core/Models/Membership

1 file changed

+0
-23
lines changed

src/Umbraco.Core/Models/Membership/User.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -373,29 +373,6 @@ protected override void PerformDeepClone(object clone)
373373
//manually clone the start node props
374374
clonedEntity._startContentIds = _startContentIds.ToArray();
375375
clonedEntity._startMediaIds = _startMediaIds.ToArray();
376-
377-
// this value has been cloned and points to the same object
378-
// which obviously is bad - needs to point to a new object
379-
clonedEntity._additionalDataLock = new object();
380-
381-
if (_additionalData != null)
382-
{
383-
// clone._additionalData points to the same dictionary, which is bad, because
384-
// changing one clone impacts all of them - so we need to reset it with a fresh
385-
// dictionary that will contain the same values - and, if some values are deep
386-
// cloneable, they should be deep-cloned too
387-
var cloneAdditionalData = clonedEntity._additionalData = new Dictionary<string, object>();
388-
389-
lock (_additionalDataLock)
390-
{
391-
foreach (var kvp in _additionalData)
392-
{
393-
var deepCloneable = kvp.Value as IDeepCloneable;
394-
cloneAdditionalData[kvp.Key] = deepCloneable == null ? kvp.Value : deepCloneable.DeepClone();
395-
}
396-
}
397-
}
398-
399376
//need to create new collections otherwise they'll get copied by ref
400377
clonedEntity._userGroups = new HashSet<IReadOnlyUserGroup>(_userGroups);
401378
clonedEntity._allowedSections = _allowedSections != null ? new List<string>(_allowedSections) : null;

0 commit comments

Comments
 (0)