[SlimDX] Access Violation when disposing a Vertex Buffer

Started by
3 comments, last by Tubos 16 years, 1 month ago
Hi, my application uses DirectX 9 via SlimDX. The versions are up-to-date. When trying to dispose a VertexShader object, the execution breaks in ComObject.cpp, line 114:
m_Unknown->Release();
The output window tells me: "A first chance exception of type 'System.AccessViolationException' occurred in SlimDX.dll". The shader is created and disposed as follows:
public VertexShader CompileVertexShader(string code, string entryPoint, string profile)
		{
			string compilationErrors;
			VertexShader shader = VertexShader.FromString(device, code, entryPoint, profile, ShaderFlags.None, out compilationErrors);
			return shader;
		}


...

if (vertexShader!=null)
	vertexShader.Dispose();
IDE is Visual Studio Express 2008, I'm using the debug version of DirectX and the release version of SlimDX. I do not dispose the ConstantTable object from the VertexShader (should I?). Also, I'm not using a SlimDX.Direct3D9.Device directly but an own class derived from it. I'll appreciate any suggestions! Tubos
Advertisement
I think in this case it would be most helpful for us if you could send us a copy of your code. It's hard to make guesses at the problem without seeing more of the problem. My email address should be in my profile.
Mike Popoloski | Journal | SlimDX
Alright, I sent you a copy.
OK, the bug has been fixed in the latest version in the repository. Thanks for sending your code, you helped us squash a few separate Release bugs that we weren't aware of.

Also, on a side note, I made ComObject explicitly derive from IDisposable, so you can stick it in your list of disposables instead of having a separate list.
Mike Popoloski | Journal | SlimDX
Thank you, keep up the great work!

This topic is closed to new replies.

Advertisement