[Gambas-user] Do embeded objects get released too upon destruction ?
gambas at ...1...
Sat Jul 23 15:26:56 CEST 2011
> If I have a class 'myClass' with the following:
> DIM k = NEW OBJECT
> PUBLIC SUB _init()
> DIM i AS INTEGER
> FOR i = 1 TO 100
> k[i] = NEW STRING 'add a string array
> k[i].add("HELLO") 'add one element with "HELLO"
> Somewhere else I have:
> DIM Q AS NEW myClass ' constructor executes 5 times
No : you are creating an array of myClass references, but you are not creating
any myClass object at all.
And this is a normal array, not an embedded one.
> Q = NULL '<---will the embeded string memory get freed too
> when the myClass object is freed ??
What is "string memory" ?
Anyway a myClass object will be freed as soon as nothing has a reference on
More information about the User