Skip to content

Fail to Unload resources on Window CLosing. #14

Description

@BohdanLytvynov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions