Skip to content

Exit() might not close game's process #5416

@kxlow

Description

@kxlow

Calling Exit() too soon seems to prevent the game from completely closing, as the process still lives on.

Tested on MonoGame 3.5 and 3.6.

using Microsoft.Xna.Framework;

// This example simply adds a red rectangle to the screen
// then updates it's position along the X axis each frame.
namespace Game1
{
	public class Game1 : Game
	{
		GraphicsDeviceManager graphics;

		public Game1()
		{
			graphics = new GraphicsDeviceManager(this);
			Content.RootDirectory = "Content";
		}

		protected override void Update(GameTime gameTime)
		{
			Exit();
		}
	}
}

If you run this w/o debugging ( does not happen w/ debugging oddly ), the window quickly appears and closes, but the process will still exist in the Task Manager indefinitely until you end the task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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