Skip to content

Commit

Permalink
D2D1CreateFactory is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Dec 22, 2024
1 parent 98d14d8 commit 4b8832a
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions win32/dwfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extern "C" {

static Bool dw_ok = false;

static ID2D1Factory *d2d_factory = NULL;
static IDWriteFactory4 *factory = NULL;
static IDWriteFontCollection1 *collection = NULL;
static IDWriteGdiInterop *gdi = NULL;
Expand All @@ -35,10 +34,6 @@ dwrite_font_init(void)
{
HRESULT hr;

hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, (REFIID) &IID_ID2D1Factory, NULL, (void**) &d2d_factory);
if ( hr != S_OK )
apiHErrRet(hr);

hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory4, (IUnknown**) &factory);
if ( hr != S_OK )
apiHErrRet(hr);
Expand All @@ -61,9 +56,7 @@ dwrite_font_done(void)
if ( gdi ) gdi ->lpVtbl->Release(gdi);
if ( collection ) collection ->lpVtbl->Release(collection);
if ( factory ) factory ->lpVtbl->Release(factory);
if ( d2d_factory) d2d_factory->lpVtbl->Base.Release((IUnknown*)d2d_factory);

d2d_factory = NULL;
factory = NULL;
collection = NULL;

Expand Down

0 comments on commit 4b8832a

Please sign in to comment.