Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M64CORE_STATE_SAVECOMPLETE callback happens too early with M64P_PARALLEL #1031

Open
alice-mkh opened this issue Aug 22, 2023 · 2 comments
Open

Comments

@alice-mkh
Copy link
Contributor

The problem is that savestates_save_m64p() is further queueing savestates_save_m64p_work(), and yet the callback in savestates_save() happens immediately once savestates_save_m64p() exits, without waiting for the work function to finish.

So if you, say, immediately shut down the core after that callback, it will break.

This only happens with savestates_type_m64p savestates, the pj64 ones are fine, since they aren't async.

And of course since without M64P_PARALLEL there's no work queue and it just calls the function instead, the bug disappears in that case

The simplest solution would be to just do the StateChanged() call in savestates_save_m64p_work(), savestates_save_pj64_zip() or savestates_save_pj64_unc(). (or savestates_save_m64p() too if it exits immediately), instead of savestates_save(). If it's fine, I'll open a PR, not sure if there are implications I'm not aware of.

@alice-mkh
Copy link
Contributor Author

Ping?

@richard42
Copy link
Member

Yes I think your suggestion is the best way to correct this problem; please file a pull request with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants