Autor Beitrag
ConditionZero
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 190

Win XP
Delphi 7 PE, C++ (Dev-C++), HTML+PHP (Dreamweaver MX), JavaScript(MS FrontPage)
BeitragVerfasst: Sa 21.04.07 16:50 
Tag,
Ja nochmal ich ;)

Wie kann man den Speicher wieder eines dyn. Array wieder freigeben?
habe dafür das (sehr unspektakulär) versucht:

ausblenden Delphi-Quelltext
1:
2:
  SetLength(Werte, 0);
  SetLength(Werte, QS);


Also erst die Länge auf 0 setzen und dann wieder auf die alte größe.
Geht das auch einfacher?

lg marc

PS: Sry für das ständige fragen grade, aber muss dringend fertig werden damit ;)
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 21.04.07 16:54 
Das ist keine saubere Lösung, da bei jedem SetLength mehr Speicher belegt wird.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)


Zuletzt bearbeitet von GTA-Place am Sa 21.04.07 17:03, insgesamt 1-mal bearbeitet
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Sa 21.04.07 17:01 
Moin!

ausblenden Delphi-Quelltext
1:
ZeroMemory(@Array, SizeOf(Array))