| View previous topic :: View next topic |
| Author |
Message |
FeliXus Guest
|
Posted: Fri Feb 16, 2007 3:34 pm Post subject: Is this true method? |
|
|
//Hi all...
//-------------------------
Type
TRec = Record
Name, Surname : String[20];
End;
Type
Athread=Class(TThread)
Constructor Create;
Public
OList : TObjectList;
End;
Procedure AThread.Create;
Begin
OList : TObjectList.Create;
OList.OwnsObjects := True;
Inherited create (True);
End;
Procedure AThread.ListAdd;
Var
Str : TMemoryStream;
Rec : TRec;
Begin
Rec.Name :='AAA';
Rec.SurName :='BBB';
Str := TMemoryStream.Create;
OList.Add(Str);
// I am not free Str
End;
Procedure AThread.ListRead;
Var
I : Integer;
Rec : TRec;
Begin
For I:=0 to OList.Count-1 do
Begin
TMemoryStream(Olist[0]).Read(Rec, Sizeof(TRec));
.........
........
Olist.Delete(0);
// I am not free any record or Stream, is TObjectList free and nil
Str (on the AThread.ListAdd) when I delete OList[0]?
// Is this true method for queu?
End;
End; |
|
| Back to top |
|
 |
Joanna Carter [TeamB] Guest
|
Posted: Fri Feb 16, 2007 4:41 pm Post subject: Re: Is this true method? |
|
|
"FeliXus" <bilcan [at] gmail.com> a écrit dans le message de news:
45d57a9e$1 (AT) newsgroups (DOT) borland.com...
Please do not cross-post, this question does not belong in this group which
is for OO design issues. Please choose only one group in future.
Joanna
--
Joanna Carter [TeamB]
Consultant Software Engineer |
|
| Back to top |
|
 |
Marc Rohloff [TeamB] Guest
|
Posted: Fri Feb 16, 2007 7:50 pm Post subject: Re: Is this true method? |
|
|
On Fri, 16 Feb 2007 10:41:57 -0000, Joanna Carter [TeamB] wrote:
| Quote: | Please do not cross-post, this question does not belong in this group which
is for OO design issues. Please choose only one group in future.
|
Nor is non-technical group a good place to post questions either. You
are sure to get better answers by posting in an appropriate group lige
delphi.language.delphi.win32 or delphi.rtl.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com |
|
| Back to top |
|
 |
|