Class TFreeNotificationObserver
Unit
Declaration
type TFreeNotificationObserver = class(TComponent)
Description
Observe when something is freed, call an event then. You need to set Observed of this component to make it notified about freeing of something. (It will use standard FreeNotification / RemoveFreeNotification under the hood.) When the Observed is freed, this component will make OnFreeNotification event.
Using this is useful if one class wants to observe freeing of multiple properties, and some of those properties may be sometimes equal. In this case using FreeNotification / RemoveFreeNotification with the main class would be unreliable (as RemoveFreeNotification removes the notification, even if you registered to it twice by FreeNotification), and requires complicated code to handles these special cases.
Using this component as a "proxy" to track each property is simpler. See e.g. TCastleThirdPersonNavigation implementation for example.
Hierarchy
- TObject
- TPersistent
- TComponent
- TFreeNotificationObserver
Overview
Methods
![]() |
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
![]() |
destructor Destroy; override; |
Properties
![]() |
property OnFreeNotification: TFreeNotificationEvent read FOnFreeNotification write FOnFreeNotification; |
![]() |
property Observed: TComponent read FObserved write SetObserved; |
Description
Methods
![]() |
procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
![]() |
destructor Destroy; override; |
Properties
![]() |
property OnFreeNotification: TFreeNotificationEvent read FOnFreeNotification write FOnFreeNotification; |
|
Called when we receive notification that something was freed. | |
![]() |
property Observed: TComponent read FObserved write SetObserved; |
|
Setting this property makes the given component Note that this property will be automatically changed to | |
Generated by PasDoc 0.16.0.

