Assigning class to pointer and back is that safe ?
From: Skybuck Flying (nospam_at_hotmail.com)
Date: 02/19/04
- Next message: Rob Kennedy: "Re: Assigning class to pointer and back is that safe ?"
- Previous message: Savannah_Alan: "Re: TListview storing pointers to Com objects?"
- Next in thread: Rob Kennedy: "Re: Assigning class to pointer and back is that safe ?"
- Reply: Rob Kennedy: "Re: Assigning class to pointer and back is that safe ?"
- Reply: Bruce Roberts: "Re: Assigning class to pointer and back is that safe ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Feb 2004 04:31:16 +0100
Hi,
var
p : pointer;
c : TsomeClass;
begin
c := TsomeClass.Create;
p := c;
end;
later:
begin
c := p;
c.destroy;
end;
So this code creates a class assigns it to a pointer... c goes out of scope,
p is remember.
Then later p is assigned back to a c variable... then c is used to destroy
the class.
Is this safe ?
So in fact this code is assigning a class reference to a pointer and back is
that safe ?
Bye,
Skybuck.
- Next message: Rob Kennedy: "Re: Assigning class to pointer and back is that safe ?"
- Previous message: Savannah_Alan: "Re: TListview storing pointers to Com objects?"
- Next in thread: Rob Kennedy: "Re: Assigning class to pointer and back is that safe ?"
- Reply: Rob Kennedy: "Re: Assigning class to pointer and back is that safe ?"
- Reply: Bruce Roberts: "Re: Assigning class to pointer and back is that safe ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|