diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index 22fb3369bc7..ffe012d3029 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -5316,10 +5316,15 @@ static UINT64 dwrite_fontface_get_font_object(struct dwrite_fontface *fontface) return 0; } - if (InterlockedCompareExchange64((LONGLONG *)&fontface->font_object, font_object, 0)) + if (!InterlockedCompareExchange64((LONGLONG *)&fontface->font_object, font_object, 0)) + { + fontface->data_context = data_context; + } + else { release_params.object = font_object; UNIX_CALL(release_font_object, &release_params); + IDWriteFontFileStream_ReleaseFileFragment(fontface->stream, data_context); } } }