Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.0.0 / tests / test / tobject9.pp
Size: Mime:
{ %OPT=-gh }
// Validate that objects with parent are finalized when statically allocated
type
  pobj = ^tobj;
  tobj = object
  public
    foo: ansistring;
    constructor init(const s: ansistring);
    destructor done;
  end;

  pobj1 = ^tobj1;
  tobj1 = object(tobj)
    constructor init;
    destructor done;
  end;

constructor tobj.init(const s: ansistring);
begin
  foo:=s;
end;

destructor tobj.done;
begin
end;

constructor tobj1.init;
var
  s: ansistring;
begin
  s:='abc';
  uniquestring(s);
  inherited init(s);
end;

destructor tobj1.done;
begin
  inherited done;
end;

var
  obj: tobj1;
  
procedure local;
var
  instance: tobj1;
begin
  instance.init;
end;

begin
  HaltOnNotReleased:=true;
  local;
  obj.init;
end.