提交 07b724f3 编写于 作者: E Ebrahim Byagowi

[dwrite] Delete remained objects

No longer noticeable memory increase on create/destroy iterations,
highly better than current state of uniscribe backend
上级 be565d17
......@@ -130,11 +130,12 @@ public:
*/
struct hb_directwrite_shaper_face_data_t {
IDWriteFactory* dwriteFactory;
IDWriteFontFile* fontFile;
IDWriteFontFileLoader* fontFileLoader;
IDWriteFontFace* fontFace;
hb_blob_t* faceBlob;
IDWriteFactory *dwriteFactory;
IDWriteFontFile *fontFile;
IDWriteFontFileStream *fontFileStream;
IDWriteFontFileLoader *fontFileLoader;
IDWriteFontFace *fontFace;
hb_blob_t *faceBlob;
};
hb_directwrite_shaper_face_data_t *
......@@ -195,6 +196,7 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
data->dwriteFactory = dwriteFactory;
data->fontFile = fontFile;
data->fontFileStream = fontFileStream;
data->fontFileLoader = fontFileLoader;
data->fontFace = fontFace;
data->faceBlob = blob;
......@@ -205,10 +207,23 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
void
_hb_directwrite_shaper_face_data_destroy(hb_directwrite_shaper_face_data_t *data)
{
data->dwriteFactory->UnregisterFontFileLoader (data->fontFileLoader);
delete data->fontFileLoader;
hb_blob_destroy (data->faceBlob);
free (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->Release();
}
if (data->fontFileLoader)
delete data->fontFileLoader;
if (data->fontFileStream)
delete data->fontFileStream;
if (data->faceBlob)
hb_blob_destroy (data->faceBlob);
if (data)
free (data);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册