gtk: a more safer code for dashes allocation

git-svn-id: trunk@22156 -
This commit is contained in:
paul 2009-10-13 22:12:28 +00:00
parent 08748087fa
commit 83c67a0a1b
2 changed files with 8 additions and 4 deletions

View File

@ -4013,9 +4013,13 @@ begin
GObject^.GDIPenWidth := dwWidth;
SetGDIColorRef(GObject^.GDIPenColor, lplb.lbColor);
GObject^.GDIPenDashesCount := dwStyleCount;
if dwStyleCount > 0 then
begin
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
for i := 0 to dwStyleCount - 1 do
GObject^.GDIPenDashes[i] := lpStyle[i];
end;
Result := HPEN(PtrUInt(GObject));
end;