After converting our project to 4.12 and updating the code I found out when my editor is starting up, it gets stuck in an infinite loop related to cube maps. In the precompiled 4.12.2 hotfix, the loop it gets stuck on is in FinalPostProcessSettings.h, line 52.
Stepping through the code quickly reveals the cause:
for(int32 i = 0; i < ContributingCubemaps.Num(); ++i)
{
--- some lines omitted ---
if(Local.AmbientCubemapTintMulScaleValue.IsAlmostBlack())
{
ContributingCubemaps.RemoveAt(i, /*bAllowShrinking=*/ false);
i--; // Maintain same index in the loop after loop increment since we removed an element.
}
}
The signature of RemoveAt is: int32 Index, int32 Count, bool bAllowShrinking. So the call to RemoveAt is wrong, the ‘false’ passed to RemoveAt is being received as Count = 0 instead of bAllowShrinking. Thus, nothing is actually removed there and yet i-- is executed. The call should be this instead:
ContributingCubemaps.RemoveAt(i, 1, /*bAllowShrinking=*/ false);
I would fix it myself and send a pull request, but I don’t have UE4 from source on my machine currently. Could someone please fix this?