Jump to content
  • Advertisement
Sign in to follow this  
Tubos

[SlimDX] Access Violation when disposing a Vertex Buffer

This topic is 3920 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!