mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 09:09:13 +01:00
[directwrite] Rely on more reference-counting for lifetime
This commit is contained in:
1 parent
41d722c3d2
commit
d2b722803f
1 file changed
+3
-7
@@ -320,12 +320,14 @@ struct hb_directwrite_face_data_t
|
||||
if (unlikely (!global || !global->success))
|
||||
FAIL ("Couldn't load DirectWrite!");
|
||||
|
||||
fontFileStream = new DWriteFontFileStream (blob);
|
||||
DWriteFontFileStream *fontFileStream = new DWriteFontFileStream (blob);
|
||||
|
||||
IDWriteFontFile *fontFile;
|
||||
auto hr = global->dwriteFactory->CreateCustomFontFileReference (&fontFileStream->fontFileKey, sizeof (fontFileStream->fontFileKey),
|
||||
global->fontFileLoader, &fontFile);
|
||||
|
||||
fontFileStream->Release ();
|
||||
|
||||
if (FAILED (hr))
|
||||
FAIL ("Failed to load font file from data!");
|
||||
|
||||
@@ -350,7 +352,6 @@ struct hb_directwrite_face_data_t
|
||||
}
|
||||
|
||||
public:
|
||||
DWriteFontFileStream *fontFileStream;
|
||||
IDWriteFontFace *fontFace;
|
||||
};
|
||||
|
||||
@@ -392,11 +393,6 @@ _hb_directwrite_face_data_destroy (hb_directwrite_face_data_t *data)
|
||||
data->fontFace->Release ();
|
||||
data->fontFace = nullptr;
|
||||
}
|
||||
if (data->fontFileStream)
|
||||
{
|
||||
data->fontFileStream->Release ();
|
||||
data->fontFileStream = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in new issue
Block a user