Files
UnrealEngineUWP/Engine/Source/Editor/SequencerCore
Andrew Rodham 7751e8cb5e Sequencer: Fixed shared data not necessarily being initialized in OnConstruct calls for child models
When a model was being (re)constructed after a change (in the case of the bug it was moving a sub-folder out of its parent) it was possible for the shared data of its children to be null, whilst its parent was non-null. This creates the issue that the parent recycling its children would not trigger hierarchy change notifications for those children (because there is no shared data to trigger the event on). For layerbars this means leaving a dangling ptr in FViewModelExtensionCollection.

Really this breaks the invariants of the shared data - it should not ever be possible for a child to have different shared data than its parent (and that invariant was reliable outside of these OnConstruct calls). To correct it we now assign all shared data before calling OnConstruct/OnDestruct. In order to prevent multiple OnConstruct calls we now have to track whether it models need construction.

Also fixed destruction of FScopedViewModelListHead not calling hierarchy changed events by explicity emptying the list on destruction. This technically is not required to fix the bug, but I think is good practice nonetheless to avoid future problems with models being destructed while they are still parented.

#jira UE-176865
#preflight 63fcda14dd78dd50f6928073

[CL 24425107 by Andrew Rodham in ue5-main branch]
2023-02-27 11:48:54 -05:00
..