[Lazarus] Unicode branch

Graeme Geldenhuys graeme at geldenhuys.co.uk
Sun Jun 30 22:14:43 CEST 2013


On 2013-06-30 17:25, Hans-Peter Diettrich wrote:
> I'm somewhat confused now. When an object has an definite "last use", it 
> should not matter when it is destroyed afterwards, sooner or later.


The simplest example... You have code that executes when the Interface
gets destroyed. A very simple example (you can Google for exact code or
more examples) is using Interfaces to change the mouse cursor to "busy",
then let the Interface set the mouse cursor back to what it initially
was when the Interface finally goes out of scope.

eg: [not really code - ]

procedure SomeLongProcedure;
begin
  SetBusyMouseCursor;
  // <----------------------- (2)
  ... long running code here
end;   //  <------------------ (1)


(1) is where Delphi will release the interface, and the mouse cursor
will be reset. Always at the end of a code block.

(2) is where FPC will release the interface, and the mouse cursor will
be reset [at the undesired place].


Like I said, this is a very simple example - but the Delphi behaviour is
consistent since forever, and allows for some very nifty code (eg:
debugging call stacks etc) - and without the need to define local
interface variables.

Regards,
  - Graeme -






More information about the Lazarus mailing list