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

AccessViolationException when window is closed #414

Open
theranix opened this issue Feb 20, 2023 · 2 comments
Open

AccessViolationException when window is closed #414

theranix opened this issue Feb 20, 2023 · 2 comments

Comments

@theranix
Copy link

RenderTarget2D.cs:

protected override void Dispose(bool disposing)
		{
			if (!IsDisposed)
			{
				if (glColorBuffer != IntPtr.Zero)
				{
					FNA3D.FNA3D_AddDisposeRenderbuffer(
						GraphicsDevice.GLDevice,
						glColorBuffer
					);
				}

				if (glDepthStencilBuffer != IntPtr.Zero)
				{
					FNA3D.FNA3D_AddDisposeRenderbuffer(      <<< EXCEPTION HERE
						GraphicsDevice.GLDevice,
						glDepthStencilBuffer
					);
				}
			}
			base.Dispose(disposing);
		}

Before exception occurs glColorBuffer is zero but glDepthStencilBuffer is not zero

@theranix
Copy link
Author

theranix commented Feb 20, 2023

As well, another exception:

"External component has thrown an exception." (HRESULT -2147467259)
   in Microsoft.Xna.Framework.Graphics.FNA3D.FNA3D_AddDisposeTexture(IntPtr device, IntPtr texture)
   in Microsoft.Xna.Framework.Graphics.Texture.Dispose(Boolean disposing) in C:\Users\Sergey\source\repos\Wosb\FNA_net7_0\src\Graphics\Texture.cs:line 49
   in Microsoft.Xna.Framework.Graphics.RenderTarget2D.Dispose(Boolean disposing) in C:\Users\Sergey\source\repos\Wosb\FNA_net7_0\src\Graphics\RenderTarget2D.cs:line 198
   in Microsoft.Xna.Framework.Graphics.GraphicsResource.Dispose() in C:\Users\Sergey\source\repos\Wosb\FNA_net7_0\src\Graphics\GraphicsResource.cs:line104
   in TheraEngine.Graphics.RenderTarget.Dispose()

@flibitijibibo
Copy link
Member

Sounds like resources are leaking - are all graphics resources being disposed when the Game is disposing?

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

2 participants