Closed GoogleCodeExporter closed 9 years ago
It's a problematic but known edge case -- I'm actually in the process of
documenting
it right now:
http://code.google.com/p/slimdx/source/browse/trunk/docs/DocSite/Help/Topics/Obj
ect%
20Lifetimes.aml
It was a danger we were aware of going into implementing the new object
lifetime
model. Basically, it's the least sucky alternative. My recommendation is that,
if
you can, always get the render target up front, and dispose it just once when
appropriate. (So this way, even the default render target has a SlimDX object
associated with it.) Avoid the behavior where you get it and conditionally
dispose
it there and then. The whole point of this was that SlimDX won't keep
increasing the
ref count on the object if you call that method multiple times, so it's okay to
continually call it frame after frame as long as you remember to Dispose it
just the
once.
No, it's not ideal, but we felt that this was the least common and easiest
problem
case to handle, given the alternatives and given SlimDX's leak debugging
support.
Let me know if there's anything else you need.
Original comment by promit....@gmail.com
on 20 Sep 2008 at 3:20
Getting target up front is a good idea. But couldn't it be done automatically
by SlimDX?
Original comment by luke.pat...@gmail.com
on 21 Sep 2008 at 2:44
That would open up a whole range of new problems about ownership and lifetime
management.
Original comment by promit....@gmail.com
on 21 Sep 2008 at 4:48
Original issue reported on code.google.com by
luke.pat...@gmail.com
on 20 Sep 2008 at 1:13