Why is the garbage collector like a pointers terminator in a standalone packaged project? (UE 5.0.3)

I notice that the garbage collector behaves in different ways.

When I run the program in the Editor my pointers survive longer, everything works fine there is no problem.

But when I run the cooked and packed standalone program the lifetime of my pointers is much shorter and the program crashes where it didn’t before. Especially inside lambda functions (asynchronous task).

I am using smart pointers.

And I’m also using the UPROPERTY() for my classes

101

What causes the different behavior of the garbage collector between the editor and the standalone?

Do I need to configure something to get the same behavior in both cases?

Thank you so much!!

I solved the problem of tasks using using safe thread mode.

// Create a Thread-safe Shared Pointer
TSharedPtr<FMyObjectType, ESPMode::ThreadSafe> NewThreadsafePointer = MakeShared<FMyObjectType, ESPMode::ThreadSafe>(MyArgs);

However I still have a serial killer pointer. And I don’t care about that. But if I have to have a serial killer I would like to have him on both sides. In the Editor and the standalone executable. Because now I have to check all the pointers in my code a second time. Pack and test lots of times.

So please, if you know how to make the garbage collector behave the same in the Editor as it does in the standalone executable let me know.

That would save me a lot of time and work.

Thank you so much!!

version 5.1.1 does not have this problem