Editor crash on load with: "UObject() constructor called but it's not the object that's currently being constructed with NewObject."

The editor crashes on startup at 71%. It first crashed after I tried compiling the project in the editor, so I tried compiling it in Visual Studio and it compiles successfully, but the editor crashes anyways.
The error message is this:

Fatal error: [File:D:\Build++UE4+Release-4.19+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2501] UObject() constructor called but it’s not the object that’s currently being constructed with NewObject. Maybe you are trying to construct it on the stack, which is not supported.

UE4Editor_Core!FDebug::AssertFailed() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:419]
UE4Editor_CoreUObject!UObject::UObject() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2502]
UE4Editor_Engine!AActor::AActor() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\engine\private\actor.cpp:68]
UE4Editor_Desidus!AActorPooler::AActorPooler() [d:\documenti\unreal projects\desidus\source\desidus\private\actorpooler.cpp:8]
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\coreuobject\private\uobject\class.cpp:2749]
UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:821]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:895]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance::ExecuteIfSafe() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:788]
UE4Editor_Core!TBaseMulticastDelegate::Broadcast() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\core\public\delegates\delegatesignatureimpl.inl:937]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\core\private\modules\modulemanager.cpp:487]
UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\projects\private\moduledescriptor.cpp:484]
UE4Editor_Projects!FProjectManager::LoadModulesForProject() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\projects\private\projectmanager.cpp:69]
UE4Editor!FEngineLoop::LoadStartupModules() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2610]
UE4Editor!FEngineLoop::PreInit() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:2027]
UE4Editor!GuardedMain() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\launch\private\launch.cpp:127]
UE4Editor!GuardedMainWrapper() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:134]
UE4Editor!WinMain() [d:\build++ue4+release-4.19+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:210]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253]
kernel32
ntdll

The ActorPooler class code is this:
ActorPooler.h
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Containers/Queue.h"
#include "ActorPooler.generated.h"

UCLASS()
class DESIDUS_API AActorPooler : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AActorPooler();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	UFUNCTION(BlueprintCallable, Category="Pooler")
	AActor* GetNext();

	UFUNCTION(BlueprintCallable, Category="Pooler")
	void Push(AActor* actor);

private:
	TQueue<AActor> enabledList;
	TQueue<AActor> disabledList;

public:
	UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category="Pooler")
	int size;
	
	UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category="Pooler")
	TSubclassOf<AActor> baseClass;

	UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = "Pooler")
	FVector baseLocation;

	UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = "Pooler")
	FRotator baseRotation;
	
	UPROPERTY(BlueprintReadOnly, EditInstanceOnly, Category = "Pooler")
	FVector baseScale;
	
};

ActorPooler.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "ActorPooler.h"


// Sets default values
AActorPooler::AActorPooler()
{
 	// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

}

// Called when the game starts or when spawned
void AActorPooler::BeginPlay()
{
	Super::BeginPlay();
	
}

// Called every frame
void AActorPooler::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);

}

AActor* AActorPooler::GetNext()
{
	
	return nullptr;
}

void AActorPooler::Push(AActor* actor)
{

}

I’m not calling the constructor anywhere and there are no references to the class in the project.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://forums.unrealengine.com/unreal-engine/announcements-and-releases/1410408-unreal-engine-bug-submission-form

Thanks

The issue here is that your class has a TQueue of AActors rather than AActor pointers. Internally, TQueue allocates and stores an “extra” node (presumably to support thread safety).

You should not have a TQueue, or any other container, of UObject-derived objects; UObjects need to be constructed using the NewObject infrastructure, rather than the container allocator. If you want to refer to UObject-derived objects, do so via a container of pointers, and keep in mind that you do not have full control over the objects’ lifetimes. Also keep in mind the need to present the pointers to the object reference collector, either by having the container be a UPROPERTY, or manually by some other means. This is important even if you know the objects are referenced elsewhere, because the object reference collector is responsible for nulling pointers when the objects are destroyed.