<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 30, 2015 at 3:27 PM, Stefan Dösinger <span dir="ltr"><<a href="mailto:stefandoesinger@gmail.com" target="_blank">stefandoesinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi,<br>
<br>
</span>- From patch 1:<br>
<br>
> +    hr = init_device(object, 1, iface, ddraw, render_target, width, height);<br>
> +    if (FAILED(hr))<br>
> +        d3drm_device_destroy(object);<br>
> +    else<br>
> +        *device = IDirect3DRMDevice_from_impl(object);<br>
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.<br>
<br>
What about render_target in this case? Clipper isn't a problem because you didn't create it - the application did.<br></blockquote><div>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.<br></div><div>If I explicitly destroy ddraw, how should I handle destroying of ddraw in d3drm_device_destroy (if it's not destroyed at that point)? <br><br><br><br><br></div><div>Jam</div></div><br></div></div>