LCL: TCustomNotebook: ignore selchange events when destroying handle

git-svn-id: trunk@18358 -
This commit is contained in:
mattias 2009-01-20 19:57:53 +00:00
parent f96550f8e2
commit 17daa1d3ef

View File

@ -794,7 +794,9 @@ begin
TCN_SELCHANGE:
begin
// set the page from the NMHDR^.idfrom
if (not fAddingPages) then begin
if (not fAddingPages) and not
(csDestroyingHandle in ControlState) then
begin
OldPageIndex:=FPageIndex;
FPageIndex := NMHDR^.idfrom;
if FPageIndex>=PageCount then
@ -814,7 +816,8 @@ begin
end;
TCN_SELCHANGING:
begin
if CanChangePageIndex then
if CanChangePageIndex and not
(csDestroyingHandle in ControlState) then
Result := 0
else
Result := 1;