[Bug] Failing ensure(QueuedRequests.Num() == 0)

Found a bug which appears in next condition.

Condition:

  1. We have UObject* based blueprint class.
  2. We have custom settings class registered with SettingsManager.
  3. We have TSubclasOf inside of our settings class.
  4. We have filled our variale (3) with our object’s class (1).
  5. We have called GetDefault() from constructor of other native (or maybe not only) class.

Here’s what happening (as far as i found) :

There is a stage inside of Unreal when every blueprint reconstructed (lets call it first) and there is a stage where all objects classes are initializing and loading their default objects (lets call it second). So second one happens inside of first and when it meets our actor (5) it tries to load our settings class and provoking population of QueuedRequests list which is populated before first stage and supposed to be empty when per-class iteration starts. So when iteration ends and function comes to an end it appears that QueuedRequests is not empty and ensure is failing.

What it leads to?

With this bug i cant package my game as it throws error on ensure failed.

Temporary workaround

I preffered to temporally move using my settings class (2) from constructor to BeginPlay function.

I have the same problem but I am not using any TSubclassOf’s in my constructors. Can you help explain how you narrowed down your problem?
I see what you mean as I was looking through the BlueprintCompilationManager.cpp and I also see that I get the error somewhere between:
UATHelper: Packaging (Windows): LogCook: Display: Cooked packages 471 Packages Remain 693 Total 1164
and
UATHelper: Packaging (Windows): LogCook: Display: Cooked packages 504 Packages Remain 686 Total 1190

But I don’t know where to go from there?