[dwrite] Delete remained objects
No longer noticeable memory increase on create/destroy iterations, highly better than current state of uniscribe backend
This commit is contained in:
parent
be565d1714
commit
07b724f341
|
@ -132,6 +132,7 @@ public:
|
||||||
struct hb_directwrite_shaper_face_data_t {
|
struct hb_directwrite_shaper_face_data_t {
|
||||||
IDWriteFactory *dwriteFactory;
|
IDWriteFactory *dwriteFactory;
|
||||||
IDWriteFontFile *fontFile;
|
IDWriteFontFile *fontFile;
|
||||||
|
IDWriteFontFileStream *fontFileStream;
|
||||||
IDWriteFontFileLoader *fontFileLoader;
|
IDWriteFontFileLoader *fontFileLoader;
|
||||||
IDWriteFontFace *fontFace;
|
IDWriteFontFace *fontFace;
|
||||||
hb_blob_t *faceBlob;
|
hb_blob_t *faceBlob;
|
||||||
|
@ -195,6 +196,7 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
|
||||||
|
|
||||||
data->dwriteFactory = dwriteFactory;
|
data->dwriteFactory = dwriteFactory;
|
||||||
data->fontFile = fontFile;
|
data->fontFile = fontFile;
|
||||||
|
data->fontFileStream = fontFileStream;
|
||||||
data->fontFileLoader = fontFileLoader;
|
data->fontFileLoader = fontFileLoader;
|
||||||
data->fontFace = fontFace;
|
data->fontFace = fontFace;
|
||||||
data->faceBlob = blob;
|
data->faceBlob = blob;
|
||||||
|
@ -205,9 +207,22 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
|
||||||
void
|
void
|
||||||
_hb_directwrite_shaper_face_data_destroy(hb_directwrite_shaper_face_data_t *data)
|
_hb_directwrite_shaper_face_data_destroy(hb_directwrite_shaper_face_data_t *data)
|
||||||
{
|
{
|
||||||
|
if (data->fontFace)
|
||||||
|
data->fontFace->Release ();
|
||||||
|
if (data->fontFile)
|
||||||
|
data->fontFile->Release ();
|
||||||
|
if (data->dwriteFactory) {
|
||||||
|
if (data->fontFileLoader)
|
||||||
data->dwriteFactory->UnregisterFontFileLoader(data->fontFileLoader);
|
data->dwriteFactory->UnregisterFontFileLoader(data->fontFileLoader);
|
||||||
|
data->dwriteFactory->Release();
|
||||||
|
}
|
||||||
|
if (data->fontFileLoader)
|
||||||
delete data->fontFileLoader;
|
delete data->fontFileLoader;
|
||||||
|
if (data->fontFileStream)
|
||||||
|
delete data->fontFileStream;
|
||||||
|
if (data->faceBlob)
|
||||||
hb_blob_destroy (data->faceBlob);
|
hb_blob_destroy (data->faceBlob);
|
||||||
|
if (data)
|
||||||
free (data);
|
free (data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue