On Thu, Jul 30, 2015 at 3:27 PM, Stefan Dösinger <stefandoesinger@gmail.com> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

- From patch 1:

> +    hr = init_device(object, 1, iface, ddraw, render_target, width, height);
> +    if (FAILED(hr))
> +        d3drm_device_destroy(object);
> +    else
> +        *device = IDirect3DRMDevice_from_impl(object);
Aren't you leaking ddraw here? It's possible that d3drm_device_destroy destroys it because ddraw is stored in object, but the caller doesn't know this. I'd be better to explicitly destroy it.

What about render_target in this case? Clipper isn't a problem because you didn't create it - the application did.
d3drm_device_create_surfaces_from_clipper sets the clipper and primary surface, and init_device sets ddraw and d3drm first before anything else, so even if any of them fail d3drm_device_destroy will ensure they're destroyed.
If I explicitly destroy ddraw, how should I handle destroying of ddraw in d3drm_device_destroy (if it's not destroyed at that point)?




Jam