jvcllaz: Fix JvTimeFrame demo crashing at program end from week view after date was scrolled into a date range without appointments.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7110 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-08-09 21:03:29 +00:00
parent 42e82eee15
commit b7f5c7b4af
3 changed files with 18 additions and 2 deletions

View File

@ -4067,13 +4067,23 @@ procedure TJvTFControl.ReleaseSchedule(const SchedName: string;
var
SchedID: string;
begin
if Assigned(ScheduleManager) then begin
SchedID := TJvTFScheduleManager.GetScheduleID(SchedName, SchedDate);
if FSchedules.IndexOf(SchedID) > -1 then
ScheduleManager.ReleaseSchedule(Self, SchedName, SchedDate)
end;
{ wp:
original code - crashes sometimes at program end in GetScheduleID
when ScheduleManager is nil
SchedID := TJvTFScheduleManager.GetScheduleID(SchedName, SchedDate);
if FSchedules.IndexOf(SchedID) > -1 then
if Assigned(ScheduleManager) then
ScheduleManager.ReleaseSchedule(Self, SchedName, SchedDate)
else
raise EJvTFScheduleManagerError.CreateRes(@RsECouldNotReleaseSchedule);
}
end;
procedure TJvTFControl.ReleaseSchedules;