dwrite: Keep corresponding data context for created backend object.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-12-08 14:10:45 +03:00 committed by Alexandre Julliard
parent 828e7173bc
commit 94d7abce63
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}
}
}