Hello,

I know that an exception handler destroy the Exception object, eg in
this case it is automaticly free:

try
  if Condition then
    raise Exception.Create('Foo');
except
  on E: Exception do
    TriggerError(E);
end;

But question is what in this case:

if Condition then begin
  E := Exception.Create('Foo');
  TriggerError(E);
end;

There is no Raise, no Exception block, so do I have to Free the
Exception object here ?

I never used this coding style, but now I have a case where it seems
logic I do this, but I want to make sure I have no memory leaks. Or is
this considered as bad coding ?

---
Rgds, Wilfried
http://www.mestdagh.biz

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to