[fpc-devel] lazarus project crash on paticular event handler call if Objects unit is used

Paul Ishenin webpirat at mail.ru
Sat Sep 26 17:08:57 CEST 2009


Jonas Maebe wrote:
> The problem is most likely that the "objects" unit declares a TObject 
> type, which is a TP-style object. As a result, the TForm1 methods do 
> not expect a Delphi-style TObject parameter, but a TP-style TObject 
> parameter (by value). I don't know how the ListView1EndDrag and 
> MenuItem1Click methods in unit1 are called, but I assume that's done 
> somehow indirectly with an objpas.TObject parameter, which would 
> result in an unbalanced stack.
Thanks. Probably you are right. TForm1.ListView1EndDrag is called from 
the next method:

procedure TControl.DoEndDrag(Target: TObject; X,Y: Integer);
begin
  if Assigned(FOnEndDrag) then FOnEndDrag(Self,Target,X,Y);
end;

I experimented more. I removed objects from the uses list and added my 
own TObject = object declaration to the Unit1. It crashes in this case also.

Best regards,
Paul Ishenin.



More information about the fpc-devel mailing list