Question about ComPtr
Question about ComPtr
Hey guys, I'm using ComPtr in a project and when i close it i get these, 19 in total
DXGI WARNING: Live Producer at 0x000001B5F56B7598, Refcount: 4. [ STATE_CREATION WARNING #0: ]
I've researched it and some are suggesting that they are not being released properly.. I can't for the life of me figure out why.
The class that uses them is being derived by another class ie: Graphics class inherits D3D11Class. D3D11Class which owns the ComPtrs, has a virtual dtor and is being called.
Any suggestion ??.
I've used the very same classes, used in the same way in another app and don't get these ?.
Peace
DXGI WARNING: Live Producer at 0x000001B5F56B7598, Refcount: 4. [ STATE_CREATION WARNING #0: ]
I've researched it and some are suggesting that they are not being released properly.. I can't for the life of me figure out why.
The class that uses them is being derived by another class ie: Graphics class inherits D3D11Class. D3D11Class which owns the ComPtrs, has a virtual dtor and is being called.
Any suggestion ??.
I've used the very same classes, used in the same way in another app and don't get these ?.
Peace
Curiosity killed the cat, satisfaction brought him back
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Question about ComPtr
Man, I've run into this a while back and for the life of me I can't remember what the issue was. I remember a few trouble shooting steps like instead of passing the ComPtr's around, just return the pointers they hold, that way the ref counts don't ever fluctuate...of course this isn't as thread safe I'm guessing, but if you aren't doing any multi-threading then no biggie.
Another thing I think was make sure they are being released in the correct order. Make sure the ID3DDevice is the first to be initialized and the last to be released.
If none of that helps, I don't have a clue anymore.
Another thing I think was make sure they are being released in the correct order. Make sure the ID3DDevice is the first to be initialized and the last to be released.
If none of that helps, I don't have a clue anymore.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Question about ComPtr
The problem I noticed you having before papa was not realizing that the &addressof operator was overloaded to call Release(), but that wouldn't be the problem here.
When passing com pointers (or shared pointers for that matter), you really gotta be conscious and careful about what you're doing. Like papa says, returning the managed address is a decent plan, or returning a ref to the com ptr works too. Know what you're doing and why when you use value semantics with smart pointers (tho it still should balance out in the end).
When passing com pointers (or shared pointers for that matter), you really gotta be conscious and careful about what you're doing. Like papa says, returning the managed address is a decent plan, or returning a ref to the com ptr works too. Know what you're doing and why when you use value semantics with smart pointers (tho it still should balance out in the end).
Chili
Re: Question about ComPtr
Well ... a duh moment, I wasn't releasing a couple of ID3D11Buffer objects, (feeling stupid, yet again ) O.o
Curiosity killed the cat, satisfaction brought him back
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Question about ComPtr
Were they not wrapped in ComPtrs?
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Question about ComPtr
No there were not, figured it was ComPtr because i never gotten that message before, mind you, I am using 2017 now.
I am fiddle farting around with creating Voxel terrains with cubes. Kinda interesting.
I am fiddle farting around with creating Voxel terrains with cubes. Kinda interesting.
Curiosity killed the cat, satisfaction brought him back
Re: Question about ComPtr
Just a thought .. have you ever tried to write the contents of a D3D11Buffer to file ?, or is it even possible.. hmmm haha I might try that
Curiosity killed the cat, satisfaction brought him back
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Question about ComPtr
Isn't it just filled with the contents you provide? Like vertices or other data?
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com