Advertisement Jump to content
Sign in to follow this  
xsirxx

Problem with shutting down?

This topic is 4934 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

I put some new code in for objects and meshs and now my program runs fine in debug. But when I run retail she bombs on me? Any ideas? I thought ok, lets put the closing code in anyways and found that its bombing in debug on this exit:
localMesh::~localMesh( void )
{
	if(pd3dDevice != NULL)
	{
		pd3dDevice->SetStreamSource (0, NULL, 0, 0);
	}
	if(IndexBuffer != NULL)
	{
		IndexBuffer->Release();
		IndexBuffer = NULL;
	}
	if(VertexBuffer != NULL)
	{
		VertexBuffer->Release();
		VertexBuffer = NULL;
	}	
	VertexList.clear();
	TriangleList.clear();
	return;
}


It bombs on IndexBuffer->Release(); and VertexBuffer->Release();

Share this post


Link to post
Share on other sites
Advertisement
Could they be non-null and still be invalid? For example, did you set them to another object somewhere, or were they already destroyed and not set to null?

Share this post


Link to post
Share on other sites
Well thats the only place i release them, and they are also set to NULL there. Other than that, I have a vector list I store all my meshs in... A mesh consists of numerous things, but two things are the VertexBuffer and IndexBuffer..?


On a vector list, it holds a copy of the mesh right, not the actual mesh that goes out of scope?

Share this post


Link to post
Share on other sites
Well I found where the problem is. It is because I store the meshs in a std::vector. Remember each mesh contains an index buffer and a vertex buffer. How can I still use std::vector with an index buffer and vertex buffer? Thanks.

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!