Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: So 07.08.05 10:23 
Hi, muß ich eigentlich eine Liste sei es eine TStringList oder TList oder TObjectList erstmal mit Clear
leeren bevor ich Liste Free aufrufe?
ebs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: So 07.08.05 12:34 
Ich meine, dass Free sowieso die ganze Liste im Speicher freigibt, und dabei wird das ganze dann quasi Clear gemacht, da es nicht mehr im Speicher da ist.
MrFox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 208

WIN 2000 Professional, Ubuntu 5.10
D3 Prof, D7 Pers, D2005 Pers, Java (Eclipse)
BeitragVerfasst: Di 09.08.05 16:55 
Sowas ähnliches gibt's schon. Bevor man ein Objekt (egal welches) mit Destroy "zerstört", sollte man immer sichergehen, dass das Objekt gleich nil ist. Doch das erledigt die Funktion FREE bereits: Sie ruft nur dann Destroy auf, wenn das Objekt ungleich nil ist.

Also: Statt Destroy immer FREE aufrufen. Sonst gibt's da nichts zu beachten.

_________________
Das Leben auf der Erde mag zwar teuer sein, aber eine jährliche Rundreise um die Sonne ist gratis mit dabei.
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Di 09.08.05 17:24 
Es reicht, Free aufzurufen. Bei TList musst du aber noch alle Objekte freigeben, welche die Liste verwaltet.
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: Di 09.08.05 17:31 
user profile iconSpaceguide hat folgendes geschrieben:
welche die Liste verwaltet.

... sofern sie nicht noch wo anders verwaltet/genutzt werden. Ansonsten hagelt es Schutzverletzungen wenn die Objekte weg sind.

_________________
Ist Zeit wirklich Geld?
Spaceguide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 552


(D3/D7/D8) Prof.
BeitragVerfasst: Di 09.08.05 18:24 
Na das ist ja selbstverständlich.