[PATCH 2/6] wined3d: Reference-count the wined3d_device_context structure.

Henri Verbeet hverbeet at gmail.com
Mon Mar 8 05:29:11 CST 2021


On Sun, 7 Mar 2021 at 23:19, Zebediah Figura <z.figura12 at gmail.com> wrote:
> @@ -2058,6 +2082,7 @@ struct wined3d_device_context * CDECL wined3d_device_get_immediate_context(struc
>  {
>      TRACE("device %p.\n", device);
>
> +    wined3d_device_context_incref(&device->cs->c);
>      return &device->cs->c;
>  }
That's inconsistent with the rest of the API. As a rule we don't
increment reference counts when returning objects, leaving that to the
caller instead if necessary. (And more often than not, it isn't.)

It may also be worth mentioning why device contexts need to be
reference counted at all. I assume there's a reason, but it's not
obvious to me from this series.



More information about the wine-devel mailing list