Recent

Author Topic: TZIBEventAlerter throwing exception when registering events  (Read 2433 times)

Groffy

  • Full Member
  • ***
  • Posts: 204
TZIBEventAlerter throwing exception when registering events
« on: November 24, 2015, 03:01:01 pm »
Linux Mint 17.2 KDE
Lazarus 1.5 trunk
FPC 3.0rc2
Zeos components 7.3 testing
Firebird SuperServer 2.5.5

I created a simple test project

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   FbConnection.Connect();
  4.  
  5.   with FbEventAlerter do
  6.   begin
  7.    Connection:= FbConnection;
  8.    Events.Add('LOGGER');
  9.  
  10.    Registered:= true;
  11.   end;
  12. end;    
  13.  

As soon the event should be registered the component raises an exception

The exception is raised in ZIPEventAlerter.pas when calling the TIBEventThread base constructor. TIBEventThread is directly derived from class TThread.

Code: Pascal  [Select][+][-]
  1. {$WARNINGS OFF}
  2. constructor TIBEventThread.Create(Owner: TZIBEventAlerter;  EventGrp: integer; TermEvent: TNotifyEvent);
  3. begin
  4.   inherited Create(true);
  5.  
  6.   FCancelAlerts := False;
  7.   Signal := TSimpleEvent.Create;
  8.   Parent := Owner;
  9.   EventGroup := EventGrp;
  10.   OnTerminate := TermEvent;
  11.  
  12.   Resume;
  13. end;
  14. {$WARNINGS ON}  
  15.  

Anybody working successfully with this control? Is it maybe an FPC3.0 issue?


Best regards
« Last Edit: November 24, 2015, 03:04:22 pm by Groffy »
Linux Mint / Windows 10 / Lazarus 3.0.0 / trunk -qt

ttomas

  • Full Member
  • ***
  • Posts: 245
Re: TZIBEventAlerter throwing exception when registering events
« Reply #1 on: November 25, 2015, 12:33:39 am »
Do you add/define UseCThreads?
Add in your project source
Code: Pascal  [Select][+][-]
  1. Uses
  2.   {$IFDEF UNIX}{$IFDEF UseCThreads}
  3.   cthreads,
  4.   {$ENDIF}{$ENDIF}
  5.  
IBEvents component use TThread internally.

Groffy

  • Full Member
  • ***
  • Posts: 204
Linux Mint / Windows 10 / Lazarus 3.0.0 / trunk -qt

 

TinyPortal © 2005-2018