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

Fail to Unload resources on Window CLosing. #14

Open
BohdanLytvynov opened this issue Aug 17, 2024 · 0 comments
Open

Fail to Unload resources on Window CLosing. #14

BohdanLytvynov opened this issue Aug 17, 2024 · 0 comments

Comments

@BohdanLytvynov
Copy link

Hello! I have discovered some bug. The problem is that the Unload event doesn't fires when we are closing the main window. So it leads to the problems with Unloading all the game resources. I have found the solution. We can use Dispatcher,ShutdownStarted event instead of Unload event of the Control. I have tested it, it worked properly. Also I have discovered that this problem is a common thing.
Here is the ref to Stackoverflow: link

So I suggest to change
Unloaded += OnUnloaded; on the 54 line in the MonoGameContent Control to:
Dispatcher.ShutdownStarted += OnUnloaded; It works for me.

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

1 participant