Critical Error on Editor Startup

Please can anyone elaborate on what might be culprit of this error?

  • Started this error after I added new C++ class to project which resulted in editor crash without finishing recompile (class *.cpp and *.h showed up in VS just fine) after recompile in VS (no error there in log) cant load project anymore.

  • Editor crashes every time while loading project at 70%

  • I’m not using any create new functionality in my actor classes. Everything is standard Actor constructors.

  • VS project compiles fine without any error

  • Build and Rebuild solution does not changed a thing.

    [2016.11.27-11.15.30:350][ 0]LogWindows:Error: Fatal error: [File:C:\Git\UnrealEngine\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2488]
    [2016.11.27-11.15.30:350][ 0]LogWindows:Error: UObject(const FObjectInitializer&) constructor called but it’s not the object that’s currently being constructed with NewObject. Maybe you trying to construct it on the stack which is not supported.

Can I somehow FORCE unreal to flush all cache and recompile all stuff? My project does not contain any assets yet so I do not worry losing any asset, it is only used to develop C++ functionality and I would love to get it back working.

Thank you.

So after couple debug trace sessions and googling I figured out, it was my mistake. I’m still wondering why it happened.

I have in my Actor derived class .h file defined code like this:

UCurveFloat* m_Curve;

But I forgot to initialize this in constructor and I’m not sure why I need to do so in constructor. I was planing to do lazy on demand initialization so if someone can explain:

Why I need to do this in Actor constructor?

m_Curve = NewObject<UCurveFloat>();

So if anyone can explain why I need to do this in constructor, I’m all ears :slight_smile:
Still new to C++ in general so maybe I’m missing something important here.

Above change fixed my project startup for me. Working again.