I then pass some of the references to BriefcaseManager. He receives them on its custom function where it saves the pointers, and initialize some things.
The pointers are still valid at this point, since it never crashes when I press play.
I also added some functions in BriefcaseManager that are called from my custom pawn for handling inputs when playing. Whenever I call these input functions, it calls a few functions which updates some components (SelectionMesh, AnimManager). However, the pointers to these saved components are no longer valid; They have somehow lost their adresses.
I have checked everything to see if it’s about the UPROPERTY macros, constructor and everything, but the thing is that my system worked before flawlessly. I know for a fact that nowhere in any of my classes I do not delete those components.
While I don’t see an answer right away, I’d suggest you set a breakpoint in ::InitializeInventory after the components are initialized, and set data breakpoints on the members which cache the pointers (GridMesh_ProcMesh, SelectionSlotMesh, AnimManager). If they are indeed somehow invalidated this will catch exactly where/why/when.
Update, I seem to have solved it.
After adding the EditAnywhere tag to my components, I could see the variables in the instance placed in the level. Apparently, one of the components was set to None, which caused the crash.
It is important to note that I was using the Hot-Reload compilator, and reading online, it seems that it could sometimes cause some problems with the connection with the blueprints. I had to recreate a completely fresh Blueprint (not duplicating my existing one) inherited from my class and the variable seemed to be fine when placing the newly created Blueprint.
I never started using Live Coding because it didn’t seem to work when reloading with it, but now it seems that I have to find out how it works because it seems like a more safer way to compile my project.