Files
UnrealEngineUWP/Engine/Source/Editor/PropertyEditor
mikko mononen 91a97670e9 [Backout] - CL27098170
[FYI] mikko.mononen
Original CL Desc
-----------------------------------------------------------------
Prevent accessing of invalid property nodes after undo and redo.

There's a window after undo (between undo and next property view tick) where property nodes point to the previous data.
If e.g. a property customization needs to refresh cached data after undo, they will try to access the data via old pointers.
Similar issue happens when removing item from array, the tick of IDetailCustomNodeBuilder gets called before we have updates the property nodes.

All these issues happen because when we update the child nodes, there are some parts of code that still hold hard refereces to them, and they are not
actually cleared on FPropertyNode::DestroyTree(). That in turn will cause IPropertyHandle to be in valid state, but pointing to data that has been freed.

- Detach property nodes recursively on FPropertyNode::DestroyTree(), also clearing parent pointers to that the invlidate property path cannot be followed.
- Call update view (same as tick) after undo to invalidate property nodes which do not point to correct memory anymore
- Use FEditorDelegates::PostUndoRedo instead of undo client, as in some rare cases with consequtive undo/redo the undo client callbacks get called on a stale pointer
- Postpone gameplay tag caching to next tick, since the delegates are called in reverse and SDetailsView gets OnUndoRedo gets called after out customization

#jira UE-190882

[CL 27169489 by mikko mononen in ue5-main branch]
2023-08-17 07:44:28 -04:00
..
2023-04-13 12:15:13 -04:00
2023-08-17 07:44:28 -04:00