You've already forked lazarus-ccr
tvplanit: Fix crash of VpDayViewPainter caused by deleting uncreated regions (issue #33763, idea by linux-man)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6439 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1070,9 +1070,9 @@ end;
|
|||||||
procedure TVpDayViewPainter.DrawEventText(const AText: String;
|
procedure TVpDayViewPainter.DrawEventText(const AText: String;
|
||||||
const AEventRect, AIconRect: TRect; ALevel: Integer);
|
const AEventRect, AIconRect: TRect; ALevel: Integer);
|
||||||
var
|
var
|
||||||
WorkRegion1: HRGN;
|
WorkRegion1: HRGN = 0;
|
||||||
WorkRegion2: HRGN;
|
WorkRegion2: HRGN = 0;
|
||||||
TextRegion: HRGN;
|
TextRegion: HRGN = 0;
|
||||||
CW: Integer;
|
CW: Integer;
|
||||||
begin
|
begin
|
||||||
if (FDayView.WrapStyle <> wsNone) then begin
|
if (FDayView.WrapStyle <> wsNone) then begin
|
||||||
@ -1104,15 +1104,9 @@ begin
|
|||||||
Rect(AEventRect.Right - 6, AEventRect.Bottom - 7, AEventRect.Right - 3, AEventRect.Bottom - 4));
|
Rect(AEventRect.Right - 6, AEventRect.Bottom - 7, AEventRect.Right - 3, AEventRect.Bottom - 4));
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
if ((AEventRect.Bottom > AIconRect.Bottom) and (AEventRect.Left > AIconRect.Right)) or
|
if WorkRegion1 <> 0 then DeleteObject(WorkRegion1);
|
||||||
(FDayView.WrapStyle = wsIconFlow)
|
if WorkRegion2 <> 0 then DeleteObject(WorkRegion2);
|
||||||
then begin
|
if TextRegion <> 0 then DeleteObject(TextRegion);
|
||||||
DeleteObject(WorkRegion1);
|
|
||||||
DeleteObject(WorkRegion2);
|
|
||||||
DeleteObject(TextRegion);
|
|
||||||
end else begin
|
|
||||||
DeleteObject(TextRegion);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
|
Reference in New Issue
Block a user