craftworkgames / MonoGame.WpfCore

MonoGame embedded inside a WPF app.
MIT License
71 stars 13 forks source link

Call to GraphicsDevice.Dispose() throws System.NullReferenceException #3

Open eulercircles opened 4 years ago

eulercircles commented 4 years ago

In a brand new project, when the window is closed and MonoGameGraphicsDeviceService.Dispose() calls GraphicsDevice.Dispose() it receives a System.NullReferenceException.

System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=SharpDX.DXGI StackTrace: at SharpDX.DXGI.SwapChain.GetFullscreenState(RawBool& fullscreenRef, Output& targetOut) at SharpDX.DXGI.SwapChain.get_IsFullScreen() at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformDispose() at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Dispose(Boolean disposing) at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Dispose() at MyLevelEditor.MonoGameControls.MonoGameGraphicsDeviceService.Dispose() in C:\Users...\Desktop\MyLevelEditor\MyLevelEditor\MonoGameControls\MonoGameGraphicsDeviceService.cs:line 31 at MyLevelEditor.MonoGameControls.MonoGameContentControl.Dispose(Boolean disposing) in C:\Users...\Desktop\MyLevelEditor\MyLevelEditor\MonoGameControls\MonoGameContentControl.cs:line 85 at MyLevelEditor.MonoGameControls.MonoGameContentControl.Finalize() in C:\Users...\Desktop\MyLevelEditor\MyLevelEditor\MonoGameControls\MonoGameContentControl.cs:line 92

limbusdev commented 4 years ago

Same here.