Sign in to follow this  

Problem with shutting down?

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

This topic is 4535 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this