c++ - Releasing resources from D3D hook -
I have a DLL that hooks the D3 call of another application. In particular, it makes some textures used for rendering. However, when the target application is closed before the hook is removed, sometimes the "zero-zero reference number" error message causes the error to appear. Obviously the reason for this is that the ownership of the hook was not released on time.
I was getting rid of this error when I hooked the phone to When I am called Since the authors of this topic had never come back, I would like to provide a solution to this problem. Instead of hooking up specific tasks, apply a proxy D3 class that should be referenced in the context of the actual interface. Upon destruction, this interface releases now to solve your problem, because you know that the real interface can never be left before your class, call the real release method from within your proxy release, if reference count 1, then release your resources and destroy the proxy class. reset call and was replaced again. Release of resources; However, I'm not sure what to do when the window is actually released, I can hook up the
release method, but there is no clear way to tell me that the device is actually Is being destroyed in or its reference count only decreases. The return value of the original
release call does not tell me a lot, because the texture of the hook is still in reference to the device, and the look of these references resembles a lot of work.
release, I can always release all my textures, and then again I can make it again when I want them again, but
Since the release may start from the underlying release call from within the D3 code, it can cause too much ground. For example, if the host application creates some small resources and releases it in every frame, then discard all the textures on the hook and make it again, which is very expensive.
Comments
Post a Comment