SIGSEGV while interface assigment
Original Reporter info from Mantis: Wicked
-
Reporter name:
Original Reporter info from Mantis: Wicked
- Reporter name:
Description:
I use the interface forward declaration like this:
IBroadCaster = interface;
{ TBroadCaster }
TBroadCaster = class(TInterfacedObject, IBroadCaster)
private
FEnable: boolean;
FEvents: TEventsList;
FSender: TObject;
public
function GetEnable: boolean;
function GetEvents: TEventsList;
function GetSender: TObject;
procedure SetEnable(AValue: boolean);
procedure SetSender(AValue: TObject);
procedure Invoke;
procedure Subscribe(const AEvent: TNotifyEvent);
procedure UnSubscribe(const AEvent: TNotifyEvent);
property Events: TEventsList read GetEvents;
property Enable: boolean read GetEnable write SetEnable;
property Sender: TObject read GetSender write SetSender;
constructor Create(AOwner: TObject);
destructor Destroy;
end;
IBroadCaster = interface
function GetEnable: boolean;
function GetEvents: TEventsList;
function GetSender: TObject;
procedure SetEnable(AValue: boolean);
procedure SetSender(AValue: TObject);
procedure Invoke;
procedure Subscribe(const AEvent: TNotifyEvent);
procedure UnSubscribe(const AEvent: TNotifyEvent);
property Events: TEventsList read GetEvents;
property Enable: boolean read GetEnable write SetEnable;
property Sender: TObject read GetSender write SetSender;
end;
And when I try to BroadCaster := TBroadCaster.Create(Self) (where FBroadCaster is IBroadCaster), an a SIGSEGV exception is raised.
But if you declare IBroadCaster previously no error occurs.
Mantis conversion info:
- Mantis ID: 24184
- OS: Windows 7 x64
- OS Build: Windows7 x64 SP1
- Platform: Win64
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 24177 (#3a03586c)