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

ximera91
Tue, 03 Apr 2018 18:02:05 +0000
Getting Started & Setup

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.

3 posts - 1 participant