Nikolay Sivov : dwrite: Release run info as soon as it' s rendered to save some memory.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 5 10:28:03 CDT 2015
Module: wine
Branch: master
Commit: 6597453403d33b7e372ae9a7d611f771f1008a3c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6597453403d33b7e372ae9a7d611f771f1008a3c
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Aug 4 11:16:35 2015 +0300
dwrite: Release run info as soon as it's rendered to save some memory.
---
dlls/dwrite/font.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 707ef6d..aaa0f42 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -2907,7 +2907,8 @@ static ULONG WINAPI glyphrunanalysis_Release(IDWriteGlyphRunAnalysis *iface)
TRACE("(%p)->(%u)\n", This, ref);
if (!ref) {
- IDWriteFontFace_Release(This->run.fontFace);
+ if (This->run.fontFace)
+ IDWriteFontFace_Release(This->run.fontFace);
heap_free(This->glyphs);
heap_free(This->advances);
heap_free(This->offsets);
@@ -3088,6 +3089,20 @@ static void glyphrunanalysis_render(struct dwrite_glyphrunanalysis *analysis, DW
IDWriteFontFace2_Release(fontface2);
analysis->ready |= RUNANALYSIS_BITMAP;
+
+ /* we don't need this anymore */
+ heap_free(analysis->glyphs);
+ heap_free(analysis->advances);
+ heap_free(analysis->offsets);
+ IDWriteFontFace_Release(analysis->run.fontFace);
+
+ analysis->glyphs = NULL;
+ analysis->advances = NULL;
+ analysis->offsets = NULL;
+ analysis->run.glyphIndices = NULL;
+ analysis->run.glyphAdvances = NULL;
+ analysis->run.glyphOffsets = NULL;
+ analysis->run.fontFace = NULL;
}
static HRESULT WINAPI glyphrunanalysis_CreateAlphaTexture(IDWriteGlyphRunAnalysis *iface, DWRITE_TEXTURE_TYPE type,
More information about the wine-cvs
mailing list