Hi,
I'm having trouble allocating and freeing an instance of a class I've defined.
Ppack=^Tpack;
Tpack= class
public
constructor init(owner:TForm;packreq:integer);
destructor done; virtual;
end;
....
procedure mainWin.load;
begin
var
oldpack:Tpack;
begin {loadpack}
oldpack:=pack;
pack:=Tpack.init(self,packreg);
if pack=NIL then pack:=oldpack
else
begin
if (oldpack<>NIL) then dispose(oldpack); /// no longer calls done() ???
That fails to compile the dispose() call with ; Error , pointer type expected.
Now I could init a Ppack and then use pack^ everywhere and dispose() that but I though class variables were a pointer anyway.
It's probalby just needs a cast or something but I don't like guessing and messing with points. Can someone point to how to use this? I don't seem to find anything helpful on dispose.
Thanks.