Hi there,

If my class constructor looks like this:

constructor TMyClass.Create(fn: string);
begin
  sl := TStringList.Create;
  try
    fs := TFileStream.Create(fn, fmOpenRead);
  except
    self.Destroy;
  end;
end;

I create the objec like:  MyInstance :=
TMyClass.Create('AnNonExistentFile');  An exception occured, I can ensure
that:

   1. there is no memory leak.
   2. the MyInstance variable is assigned *nil*?

Thanks
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to