cocoa: fix memory corruption

git-svn-id: trunk@34916 -
This commit is contained in:
paul 2012-01-25 05:01:31 +00:00
parent b17a03f253
commit 6e6c4d9600

View File

@ -966,8 +966,10 @@ var
Range: NSRange;
begin
Range := FLayout.glyphRangeForTextContainer(FTextContainer);
SetLength(Result, Range.length);
// required length + 1 space
SetLength(Result, Range.length + 1);
FLayout.getGlyphs_range(@Result[0], Range);
SetLength(Result, Range.length);
end;
procedure TCocoaTextLayout.Draw(ctx: NSGraphicsContext; X, Y: Integer; FillBackground: Boolean; DX: PInteger);