Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ms291052

Memory Leak in D3DXIntersect?

This topic is 5460 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''m calling this function for my ColDet by using:
bool PointInRoom(D3DXVECTOR3 pos)
{
	D3DXVECTOR3 up = D3DXVECTOR3(0.0f, 1.0f, 0.0f);
	BOOL bHit;
    DWORD dwFace;
    FLOAT fBary1, fBary2, fDist;
	LPD3DXBUFFER idb;
	DWORD count;
	D3DXIntersect(g_Room.m_pMesh, &pos, &up, &bHit, &dwFace, &fBary1, &fBary2, &fDist, &idb, &count);
	if(count%2) return true;
	else return false;
	idb = NULL;
	return 1;
}
and it''s causing quite a memory leak. I assume it''s my code and not the function but I''m not 100% sure on why.

Share this post


Link to post
Share on other sites
Advertisement
Fairly sure its because you don''t ->Release() that LPD3DXBUFFER. And since it doesn''t appear your a re using it, you can just pass in 0.

regards,
-Eric

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!