# HG changeset patch # User Frank Benoit # Date 1219327735 -7200 # Node ID af37dd280317a0247e2ed90a77aa67db2f10c5c1 # Parent 35d730fb5e9fbbc6ecaa2b918bc7cd9b31ca05e4 Fix: set SCRIPT_CACHE to zero diff -r 35d730fb5e9f -r af37dd280317 dwt/graphics/TextLayout.d --- a/dwt/graphics/TextLayout.d Thu Aug 21 09:57:23 2008 +0200 +++ b/dwt/graphics/TextLayout.d Thu Aug 21 16:08:55 2008 +0200 @@ -2899,18 +2899,16 @@ bool shape (HDC hdc, StyleItem run, wchar[] wchars, int[] glyphCount, int maxGlyphs, SCRIPT_PROPERTIES* sp) { bool useCMAPcheck = !sp.fComplex && !run.analysis.fNoGlyphIndex; if (useCMAPcheck) { - ushort[] glyphs = new ushort[wchars.length]; + scope ushort[] glyphs = new ushort[wchars.length]; if (OS.ScriptGetCMap(hdc, run.psc, wchars.ptr, wchars.length, 0, glyphs.ptr) !is OS.S_OK) { if (run.psc !is null) { OS.ScriptFreeCache(run.psc); glyphCount[0] = 0; int[1] one = 1; - // OS.MoveMemory( run.psc, one.ptr, (void*).sizeof ); - // DWT: FIXME This should be checked, it works in Java with the MoveMemory + *cast(int*)run.psc = 0; } return false; } - //delete glyphs; } auto hr = OS.ScriptShape(hdc, run.psc, wchars.ptr, wchars.length, maxGlyphs, &run.analysis, run.glyphs, run.clusters, run.visAttrs, glyphCount.ptr); run.glyphCount = glyphCount[0]; @@ -2931,8 +2929,7 @@ if (run.psc !is null) { OS.ScriptFreeCache(run.psc); glyphCount[0] = 0; - int[1] one = 1; - OS.MoveMemory( run.psc, one.ptr, (void*).sizeof ); + *cast(int*)run.psc = 0; } run.glyphCount = 0; return false;