Autor Beitrag
Speed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: So 18.09.05 09:33 
Hey,

Hab heut mal ne Frage zur OOP.

Ich erzeug im Konstruktor so richtig viele Shapes. Muss ich die dann im Destructor alle einzeln wieder freigeben, oder werden die automatisch freigegeben, da es ja als Destructor deklariert ist.

Hab es erst gemacht, das ich sie einzeln alle freigebe über ne Schleife, aber das dauert mir irgendwie zu lange, weil sind wirklich viele. Gibts da net nen schnelleren Weg???

MfG Speed
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 18.09.05 09:34 
Wenn du sie in deinem Konstruktor initialisierst musst du sie auch im Destruktor wieder freigeben ;)

AXMD
Speed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: So 18.09.05 09:45 
Ach Mist... :evil:

Ok danke.

Bloß mal so theoretisch: Was isn, wenn ichs ne mache???
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 18.09.05 09:50 
Dann fabrizierst du traumhafte Löcher im RAM :mrgreen:

AXMD
Speed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 48

WIN XP
Delphi 2006 Prof.
BeitragVerfasst: So 18.09.05 10:02 
Oh schön, wollt ich schon immer mal. :D

Nee, hätt ich mir eigentlich denken können.

Dank dir, da muss ichs wohl doch so machen, wie ichs erst hatte.