[MPlayer-dev-eng] [PATCH] Direct3D Much better D3D management

Georgi Petrov gogothebee at gmail.com
Tue Dec 2 15:25:55 CET 2008


> Hello,
>
> applied.

Thanks.

>> +    if (priv->d3d_backbuf != NULL) {
>> +        IDirect3DSurface9_Release(priv->d3d_backbuf);
>> +        priv->d3d_backbuf = NULL;
>>      }
>
> Btw. have you tried what happens when you call Release on a NULL
> pointer?

No...

> All these checks might be unnecessary.
> Also, if they are needed, what do you think about writing
>
>>     if (priv->d3d_backbuf)
>>         IDirect3DSurface9_Release(priv->d3d_backbuf);
>>     priv->d3d_backbuf = NULL;
>
> Instead? I cam to prefer it because
> 1) It is more obvious that priv->d3d_backbuf is always NULL afterwards
> 2) you save the {}, and essential it becomes just a "guard-if" for the
>   called function.


I understand. There's no difference for me, but I send a patch for all
deallocations in destroy_d3d_surfaces. Apply them if you like it
better.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: destroy.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20081202/69031346/attachment.txt>


More information about the MPlayer-dev-eng mailing list