In an attempt to understand what’s going on, I just implemented an empty destructor for the class. I put a breakpoint and a log-message printing the adress (this) in both the constructor and the destructor.
As it turns out, the editor creates a “Default__UStratGI” during startup, which doesn’t show up by searching for it with console commands, and it’s the same object/adress that causes the destructor crash on exiting.
But why doesn’t it crash when I start PIE before exiting?..
I also checked the static pointer and it’s always NULL (as it should be) before exiting. So I highly doubt it has anything to do with it.
edit: when I hit play, my game instance gets 3 constructor calls at different adresses and with different object names. When I stop PIE, there’s only 1 destructor call however? I won’t even try to understand that, but is it normal?..
edit2: isn’t it strange that both in the constructor and the destructor of the “Default__StratGI” the this-ptr is 00000000374AF900, but right after the empty destructor-call the value of “Ptr” in the function above is 0x00000000ffffffff ?? Shouldn’t it be the same adress?