SetRelativeLocation crashing game on exit
I have a UObject that implements FTickableGameObject. At every tick, I take an external static mesh component and call SetRelativeLocation on it.
When I exit the game, it crashes with the following message:
This happens on line 491 of SceneComponent.cpp:
With the stack trace going back to me calling SetRelativeLocation. What kind of check do I need to put around my code to have this crash not happen? Or better yet, is there any way to automatically stop ticking when the game ends?
The simplest check of course would be
Let's see if this is enough already. Otherwise write a comment below.
answered Jan 03 '17 at 03:18 PM
It looks like you are trying to reference something that is no-longer there. As suggested by Schdek it is worth testing for a NULL reference, but then also check if it is valid
In your example it looks like StaticMeshComp would be being set to a non-NULL value (0xFFFFFFFFFFFFFFFF) so the test for NULL will pass, as the value isn't NULL. The IsValidLowLevel should check that the reference is valid and whatever it points too checks out.
answered Jan 05 '17 at 08:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here