Exception on Alt+F4

On pressing Alt+F4 an exception is thrown on the _form.Show() line. I’m running MonoGame 3.5 (DX).

    internal void RunLoop()
        // https://bugzilla.novell.com/show_bug.cgi?id=487896
        // Since there's existing bug from implementation with mono WinForms since 09'
        // Application.Idle is not working as intended
        // So we're just going to emulate Application.Run just like Microsoft implementation

-----> _form.Show();

Any ideas how to fix this one?


Hmmm… I’m not getting it on Windows, DX Monogame 3.6. I doubt it’s the monogame version, but maybe?

Is there a reason this exception is a nuisance for you, though? Since the program is quitting anyway, you could just catch the exception silently and let the program close. It’s not fixing the bug, but it might work temporarily?

What is type the type of the exception? What does it say?

The exception details are:-

Exception thrown: ‘System.ObjectDisposedException’ in System.Windows.Forms.dll

    Message    "Cannot access a disposed object.\r\nObject name: 'WinFormsGameForm'."    string


You’re pressing alt+F4 before the game is running?

I wait for the window to show and rendering and then press ALT+F4.

Can you post a stack trace? And possibly try MG 3.6?