[PATCH] d2d1: Add ID2D1GeometryGroup stub.

Henri Verbeet hverbeet at gmail.com
Tue Feb 12 08:46:34 CST 2019


On Sun, 10 Feb 2019 at 02:16, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> +static ULONG STDMETHODCALLTYPE d2d_geometry_group_Release(ID2D1GeometryGroup *iface)
> +{
> +    struct d2d_geometry *geometry = impl_from_ID2D1GeometryGroup(iface);
> +    ULONG refcount = InterlockedDecrement(&geometry->refcount);
> +    unsigned int i;
> +
> +    TRACE("%p decreasing refcount to %u.\n", iface, refcount);
> +
> +    if (!refcount)
> +    {
> +        for (i = 0; i < geometry->u.group.geometry_count; ++i)
> +            ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
> +        d2d_geometry_cleanup(geometry);
> +        heap_free(geometry);
> +    }
This leaks "src_geometries".

> +HRESULT d2d_geometry_group_init(struct d2d_geometry *geometry, ID2D1Factory *factory,
> +        D2D1_FILL_MODE fill_mode, ID2D1Geometry **geometries, unsigned int geometry_count)
> +{
> +    unsigned int i;
> +
> +    d2d_geometry_init(geometry, factory, &identity, (ID2D1GeometryVtbl *)&d2d_geometry_group_vtbl);
> +
> +    if (!(geometry->u.group.src_geometries = heap_alloc(geometry_count * sizeof(*geometries))))
I'd feel a little better if this used heap_calloc().



More information about the wine-devel mailing list