Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/d2d1/d2d1_private.h | 5 ++++- dlls/d2d1/effect.c | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 98092d80951..bc07378bd20 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -572,9 +572,12 @@ struct d2d_effect_context { ID2D1EffectContext ID2D1EffectContext_iface; LONG refcount; + + ID2D1DeviceContext *device_context; };
-void d2d_effect_context_init(struct d2d_effect_context *effect_context) DECLSPEC_HIDDEN; +void d2d_effect_context_init(struct d2d_effect_context *effect_context, + ID2D1DeviceContext *device_context) DECLSPEC_HIDDEN;
struct d2d_effect_info { diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c index 5709afed7a5..74878a620b4 100644 --- a/dlls/d2d1/effect.c +++ b/dlls/d2d1/effect.c @@ -72,6 +72,7 @@ static ULONG STDMETHODCALLTYPE d2d_effect_context_Release(ID2D1EffectContext *if
if (!refcount) { + ID2D1DeviceContext_Release(effect_context->device_context); heap_free(effect_context); }
@@ -279,10 +280,11 @@ static const ID2D1EffectContextVtbl d2d_effect_context_vtbl = d2d_effect_context_IsBufferPrecisionSupported, };
-void d2d_effect_context_init(struct d2d_effect_context *effect_context) +void d2d_effect_context_init(struct d2d_effect_context *effect_context, ID2D1DeviceContext *device_context) { effect_context->ID2D1EffectContext_iface.lpVtbl = &d2d_effect_context_vtbl; effect_context->refcount = 1; + ID2D1DeviceContext_AddRef(effect_context->device_context = device_context); }
static inline struct d2d_effect *impl_from_ID2D1Effect(ID2D1Effect *iface)