I have a TPersistent defined as follows:
TGlyph = class(TPersistent)
private
FOwner: TControl;
FLayout: TGlyphAlignment;
FVisible: Boolean;
FImageIndex: Integer;
FImages: TImageList;
..............
protected
procedure Invalidate;
public
constructor Create(AOwner: TControl);
destructor Destroy; override;
.............
published
property ImageIndex: Integer read FImageIndex write SetImageIndex default -1;
property Images: TImageList read FImages write SetImages;
.............
end;
Is it essential to have a notification procedures that assign nil value to FImages field, such as the kind you use for TComponent?
procedure TGlyph.Notification(AComponent: TComponent; Operation: TOperation);
begin
inherited;
if (Operation = opRemove) and (AComponent = FImages) then
begin
FImages.OnChange := nil;
FImages := nil;
Invalidate;
end;
end;
if so, how should be written this procedure?
Thank you, Enzo