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

Window is set to null before UnloadContent on the WindowsDX platform #8096

Open
2 tasks done
Apostolique opened this issue Nov 22, 2023 · 0 comments
Open
2 tasks done

Comments

@Apostolique
Copy link
Contributor

Prerequisites

  • I have verified this issue is not present in the develop branch
  • I have searched open and closed issues to ensure it has not already been reported.

MonoGame Version

MonoGame 3.8.1.303

Which MonoGame platform are you using?

MonoGame Windows Desktop Application (mgwindowsdx)

Operating System

Windows

Description

On the DesktopGL platform, it's possible to access the game window during UnloadContent. This makes it possible to save the window size and position for example. The window is only disposed during the Platform.Dispose:

protected override void Dispose(bool disposing)
{
if (_view != null)
{
_view.Dispose();
_view = null;
Joystick.CloseDevices();
Sdl.Quit();
}

On the WindowsDX platform, the Windows is disposed earlier in Platform.Exit:

public override void Exit()
{
if (_window != null)
_window.Dispose();
_window = null;
Window = null;
}

Steps to Reproduce

Access the game window during UnloadContent.

Minimal Example Repo

No response

Expected Behavior

The game window shouldn't be disposed before UnloadContent is done.

Resulting Behavior

The game window position and size can't be accessed.

Files

No response

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