RxFPC:RxViewsPanel1 - fix AV on delete ImageList

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7074 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2019-07-26 13:34:21 +00:00
parent ad4c29b027
commit 781fc2f5cd
3 changed files with 133 additions and 4 deletions

View File

@ -117,6 +117,7 @@ type
procedure InternalSelectView(Item:TRxViewsPanelItem);
protected
procedure Loaded; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -247,6 +248,17 @@ begin
FItems[FItemIndex].FButton.Down:=true;
end;
procedure TRxViewsPanel.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
if Operation = opRemove then
begin
if AComponent = FImageList then
SetImageList(nil)
end;
end;
constructor TRxViewsPanel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);