diff --git a/ideintf/imagelisteditor.pp b/ideintf/imagelisteditor.pp index 55ad02bbba..a21917899e 100644 --- a/ideintf/imagelisteditor.pp +++ b/ideintf/imagelisteditor.pp @@ -321,6 +321,7 @@ begin ImageList.Insert(TreeView.Selected.ImageIndex, T, nil); finally ImageList.EndUpdate; + T.Free; end; TreeView.Invalidate; diff --git a/lcl/interfaces/win32/win32wsimglist.pp b/lcl/interfaces/win32/win32wsimglist.pp index 7d7df4fd6d..0f99e51a39 100644 --- a/lcl/interfaces/win32/win32wsimglist.pp +++ b/lcl/interfaces/win32/win32wsimglist.pp @@ -127,7 +127,7 @@ class procedure TWin32WSCustomImageList.AddData(AListHandle: TLCLIntfHandle; ACo DataCount := AWidth * AHeight; DataSize := DataCount * SizeOf(AData^); - while ACOunt > 0 do + while ACount > 0 do begin System.Move(AData^, BitsPtr^, DataSize); if AReplaceIndex = -1