Archived

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

ByteMe95

CD3DFont troubles, really need smoe help

Recommended Posts

ByteMe95    122
After days of tracking down my memory leaks I found out that my d3ddevice isnt getting released on exit because its reference count doesnt go to 0, it goes to like 3 Now i realize that I have 3 d3dfonts, and some people were telling me that creating the d3dfont increases the ref count. Now Ive looked EVERYWHERE in the d3dfont code and I cant find anywhere where it would increment the reference count of my d3ddevice object. And it apparently isnt decrementing it either. So, I ask does anyone know where/why this ciould be happening?? Im 99% sure its from the d3dfont code. On apossibly unrelated note, my d3d object (IDirect3D) doesnt get released either, its ref count goes down 1. But I''d rather figure out the d3ddevice problem first. ByteMe95::~ByteMe95() My S(h)ite

Share this post


Link to post
Share on other sites
Shannon Barber    1681
stub-out (comment) out the code that makes/uses the fonts and make certain it''s them. Slowly add the code back in until the problem comes back.

Are you releasing the d3dfonts correctly?

Use the CComPtr smart-pointer (in atlbase.h I think) to automatically handle reference counting.

Share this post


Link to post
Share on other sites
TheAIDSVirus    122
Hrm, I don''t think D3DFont increases the refence count of D3DDevice. If it does, I''ve never had to address the problem in my programs. I''m not certain, but you may want to check somewhere else in your code. I believe someone has led you off in the wrong direction.

----
AIDS

Share this post


Link to post
Share on other sites
niyaw    158
quote:
Original post by ByteMe95
Now Ive looked EVERYWHERE in the d3dfont code and I cant find anywhere where it would increment the reference count of my d3ddevice object. And it apparently isnt decrementing it either.


it creates vertex buffers, which hold references to the device object.

edit: and, debug runtime provides break on alloc id functionality that you may find helpful.

[edited by - niyaw on November 5, 2002 10:10:54 PM]

Share this post


Link to post
Share on other sites