<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 8, 2016 at 9:54 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">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<span><br>
Am 2016-05-08 um 11:31 schrieb Aaryaman Vasishta:<br>
> +    /* d3drm intentionally leaks a reference to IDirect3DRM here if texture has already been initialized. */<br>
> +    if (texture->d3drm)<br>
> +        IDirect3DRM_AddRef(texture->d3drm);<br>
> +<br>
> +    if (texture->image)<br>
> +        return D3DRMERR_BADOBJECT;<br>
> +    if (FAILED(hr = d3drm_texture_load(texture, filename, FALSE)))<br>
> +        return hr;<br>
</span>Does it also leak if the file fails to load? It's probably better to create the image and then pass it to InitFromImage instead of re-coding this part.<br>
<br></blockquote><div> Not afair while writing the tests, but it will leak if the texture was already initialized.<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there any situation where texture->d3drm would be NULL? The same question applies to the newly introduced check in d3drm_texture_destroy.<br></blockquote><div>At this point, LoadTexture is not implemented yet. Currently LoadTexture doesn't assign d3drm1, which means that check will be needed in case a texture created by LoadTexture needs to be released. I've removed the NULL check in the next patch after LoadTexture is implemented.<br><br></div><div>Cheers,<br></div><div>Aaryaman <br></div></div><br></div></div>