win32: TCustomListBox: don't recreateWnd if we are destroying handle

git-svn-id: trunk@16410 -
This commit is contained in:
paul 2008-09-04 12:15:08 +00:00
parent 3083aece74
commit 5f76c9b083
2 changed files with 5 additions and 4 deletions

View File

@ -139,7 +139,7 @@ begin
GetItemIndex; GetItemIndex;
//DebugLn('[TCustomListBox.FinalizeWnd] A ',FItems.ClassName); //DebugLn('[TCustomListBox.FinalizeWnd] A ',FItems.ClassName);
// create internal item list // create internal item list
if Assigned(FItems) then begin; if Assigned(FItems) then begin
NewStrings:= TExtendedStringList.Create(GetCachedDataSize); NewStrings:= TExtendedStringList.Create(GetCachedDataSize);
// copy items (text+objects) from the interface items list // copy items (text+objects) from the interface items list

View File

@ -93,11 +93,12 @@ End;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TWin32ListStringList.Sort; procedure TWin32ListStringList.Sort;
Begin begin
// The win api doesn't allow to change the sort on the fly, // The win api doesn't allow to change the sort on the fly,
// so is needed to recreate the window // so is needed to recreate the window
RecreateWnd(FSender); if not (csDestroyingHandle in FSender.ControlState) then
End; RecreateWnd(FSender);
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------