When I exit the editor, I get an engine crash.

My project is creating a texture at runtime.
I used AddToRoot() to avoid garbage collection.
I have created an actor that collects the texture at runtime, and when the BeginEnd event Is called, I use ConditionalBeginDestroy() to destroy the texture.

There was no problem keeping the game play on and off in this state. However, when I exit the editor, a crash occurs. I think the problem is probably with the GC side.

Is there an exact cause for this problem or is there a way I can solve it?

I had similar issue in 4.12. What minor version of engine You’re using?

I have had the same problem since version 4.11, and I am currently using the 4.13.2 version of the engine.

Have You tried to migrate on most new? (4.14.3)
It may be a fixed bug.

Also You have to make a bug report. (move this topic to Bug Reports section)

Engine crash is a bug (may be not Epic fault but still).

I will update to the latest version.

Hey,

Is your texture defined as a UPROPERTY() in code? If so it should handle GC automatically without needing to be destroyed manually. Try removing the call to ConditionalBeginDestroy() and let me know if the crash continues. If so, please include the callstack and log files from the crash for additional information.

. Thanks to your reply, I solved the problem.

I used CollectGarage instead of AddToRoot () and ConditionalBeginDestroy (). It is very well done.