From: <ah...@us...> - 2009-05-07 14:53:30
|
Revision: 12305 http://jvcl.svn.sourceforge.net/jvcl/?rev=12305&view=rev Author: ahuser Date: 2009-05-07 14:53:17 +0000 (Thu, 07 May 2009) Log Message: ----------- Fixed: Accessing TJvDropCalendar after it was destroyed. Modified Paths: -------------- trunk/jvcl/run/JvDatePickerEdit.pas Modified: trunk/jvcl/run/JvDatePickerEdit.pas =================================================================== --- trunk/jvcl/run/JvDatePickerEdit.pas 2009-05-05 20:10:29 UTC (rev 12304) +++ trunk/jvcl/run/JvDatePickerEdit.pas 2009-05-07 14:53:17 UTC (rev 12305) @@ -1330,8 +1330,7 @@ DoChange; end; -procedure TJvDropCalendar.CalSelect(Sender: TObject; - StartDate, EndDate: TDateTime); +procedure TJvDropCalendar.CalSelect(Sender: TObject; StartDate, EndDate: TDateTime); begin DoSelect; end; @@ -1382,9 +1381,19 @@ end; procedure TJvDropCalendar.DoSelect; +var + LastCloseOnLeave: Boolean; begin - if Assigned(OnSelect) then - OnSelect(Self); + { Protect against releasing the calendar in the message loop of the + Application.HandleException dialog. } + LastCloseOnLeave := CloseOnLeave; + try + CloseOnLeave := False; + if Assigned(OnSelect) then + OnSelect(Self); + finally + CloseOnLeave := LastCloseOnLeave; + end; end; procedure TJvDropCalendar.DoShow; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |