Hi, very simple scenario:
I have a c++ AGameMode subclass, inherited by a blueprint and in turn set as default gameMode.
When the garbage collector kicks in (or when I force garbage collection), the destructor of my c++ class is invoked, causing all sort of issues to my game that was relaying on this class being persistent.
What could I be doing wrong? is this the expected behaviour?
Does your GameMode itself gets garbage collected or some other classes that were initialized inside GameMode?
turns out it was another apparent misbehavior that got me confused:
to test garbage collection of the gamemode I had a print statement in the destructor of my subclass, and that call was being executed after the GC kicked in.
The gamemode was not deleted though! and that’s what is weird and caused a lot of confusion for me.