binding event from my save game causes problem on exit/quit

my save game class I defined in c++ is a member of my controller, I bind a event in my controller when my save game contents change.

on map transition/editor quit it breaks here, I can handle this (by unbinding) for most cases except for just hitting esc when i PIE - a minor annoyance now, and not binding to this event solves it completely, I can find another way to solve this task

fyi

[2016.11.16-15.04.51:828][ 83]LogWindows:Error: === Critical error: ===
[2016.11.16-15.04.51:828][ 83]LogWindows:Error: 
[2016.11.16-15.04.51:828][ 83]LogWindows:Error: Fatal error: [File:C:\4_14_0\Engine\Source\Runtime\Core\Private\Serialization\Archive.cpp] [Line: 258] 
[2016.11.16-15.04.51:829][ 83]LogWindows:Error: FArchive does not support FWeakObjectPtr serialization. Use FArchiveUObject instead.
[2016.11.16-15.04.51:829][ 83]LogWindows:Error: 
[2016.11.16-15.04.51:829][ 83]LogWindows:Error: 
[2016.11.16-15.04.51:829][ 83]LogWindows:Error: 
[2016.11.16-15.04.51:857][ 83]LogExit: Executing StaticShutdownAfterError
[2016.11.16-15.04.51:865][ 83]LogWindows: FPlatformMisc::RequestExit(1)
[2016.11.16-15.04.51:865][ 83]Log file closed, 11/16/16 10:04:51

Hey BPANDREW-

Does your save game class call any functions on exit? If possible, cold you provide steps to help me reproduce the issue or a sample project for me to see the issue directly? Are you using FArchive anywhere in your code? If so, does switching to FArchiveUObject instead change the behavior at all?

no, its the mere act of the event being called - my save game itself has internal functions - and I’ve never called FArchive once in my project

Which event are you referring to? Please provide reproduction steps or a sample project with the issue occurring for additional information.

So this is a minor issue in windows, but 100% crashes in android

UFUNCTION(BlueprintImplementableEvent, Category = SYSTEM_INVENTORY)
void WEIGHT_CHANGED();

I load and bind this saved game event in the OnPostLogin event from my game mode

this event is declared in my savegame class that inherits USaveGame - my controller loads this save game + binds to the event… when bound, if called, it crashes out my android app

I can code my way around this - but this is a 100% new issue in 4.14 as I coded this in 4.11

, can you provide a private place where I can upload a blueprint (or perhaps your email?)? My game jam game is having this same issue when attempting to update to 4.14, my player controller bp can’t even load in the editor without this crash happening.

Hey BPANDREW-

If you’re able to upload a sample project with this crash to google drive or dropbox, you can send me a PM on the forums with a download link.

Hey BPANDREW-

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will follow up.

Cheers

Hello. Having the same Problem, so I follow up. It happens on my in 4.14 when my savegame does contain an eventDispatcher (for example onUpdated which I want to bind on other objects to be informed if Settings change). After calling “save game to slot” with a reference to self as Save game object it crashes. If I delete the eventdispatcher all works fine.
Btw. I’m working with blueprints

Hey Adnoh-

Can you provide the callstack from the crash? Also, how are you setting up your save feature? If you use the same setup in a new proejct, does that cause a crash as well? If so, please provide the setup steps used or the sample project to help me investigate the issue further.

Hey , yes - I’ve just created a new empty project for testing and still get the crash.
Attached 2 Screenshots of the SaveGameBP (with the eventdispatcher) and a levelBP calling it. But I was a little wrong - it crashes only if you’ve bind to the EventDispatcher before saving (Blue Line skipping binding is ok)
If you provide me some space or mail I can send you the project if you need it.
Thank you for your afford

Thanks for the screenshots. Setting up a project based on these, I was able to determine the “Save Game to Slot” node of the first screenshot is causing the crash. Bypassing this node prevents the crash from occurring. Based on the documentation (https://docs.unrealengine.com/latest/INT/Gameplay/SaveGame/Blueprints/) , calling Save Game to Slot inside the SaveGame blueprint is not a standard workflow. Using the setup in the following blueprint (where Save Game to Slot is called in the level blueprint) the binding was created successfully without a crash. Let me know if this helps.

hm…not really. It looks like a workaround hack under lab conditions. There is a good cause why I’d like the logic inside of my savegame function and not to call “save game to slot” outside and the “post save event” myself in the other blueprints. I feel like the relevant logic should be capsuled inside of the savegame.

But beside of this - you can still bring it to crash if you bind to the event Listener BEFORE calling “save game to slot” which makes me really feel like it is a bug because this would be the normal state to have some event subscribers set up before actually saving something (it seems to crash when save game to slot serialises the object and has an active binded event dispatcher in it).
Sorry my english isn’t the best :slight_smile: hope you get it.
For example in my screenshot if I hook up sequence 0 AFTER the bind - it still crashes.

My regular use case is for example to bind to the dispatcher on several spots like in the UI and on some database Objects. On any point the user saves his settings I need them to be notified to do some logic llike push it to the server Database for example.

Based on the information provided, I found where this issue has been reported: Unreal Engine Issues and Bug Tracker (UE-40448) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

i coded around this i essentially used a “is dirty” system, and polled for it, not as slick, but I didnt want to be stuck on this issue for a long time

Holy cow - target fix 4.17. Can I help with it and send a pull request or what’s the regular way? It can’t be that big job to fix this.
But thank you for your afford!

thank you. me too. I was in best mode and just wrapped another savegamebp around it. in this i can setup my eventdispatchers as i like and provide a function save which internally calls the original savegame - not elegant, but works like a charme and i don’t need to change any relevant game logic :wink:

ah I like that idea too, hey do yo mind up voting this bug report? I want the karma so I can win a forum badge

You mean UE-40448? I’ve already voted. Or what do you mean? What do I need to do :slight_smile: I don’t understand the hole Karma thing - my Karma is always a good when working with UE :smiley:

Just ran into this.