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

Georgi Petrov gogothebee at gmail.com
Mon Dec 8 11:18:12 CET 2008


On Tue, Dec 2, 2008 at 4:25 PM, Georgi Petrov <gogothebee at gmail.com> wrote:
>> 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.
>

Did you forget this patch?



More information about the MPlayer-dev-eng mailing list