From 17daa1d3ef26cafd62de0fa9d642c3fb8df8064c Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 20 Jan 2009 19:57:53 +0000 Subject: [PATCH] LCL: TCustomNotebook: ignore selchange events when destroying handle git-svn-id: trunk@18358 - --- lcl/include/customnotebook.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index 337ebfb5a2..356483da41 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -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;