|
Hi to all! A bit of commented code should be enough to explain my problem: Point by point, please correct me where I'm wrong! A: valueArray allocates 100 floats. refArray is just a pointer to valueArray. B: this is confirmed here: changes in valueArray can be accessed through refArray. C: Here's where I don't get it. valueArray allocates at a new adress, and ref array still points to the old one. Will the memory get garbage collected if refArray is local? Or will it cause a leak? Many thanks for your insights! G
(comments are locked)
|
|
It will get garbage collected when the system is ready to collect again, that will happen at any time after the last reference to refArray. You will not leak memory that way. Thanks! I'm at peace.
Jul 31 '12 at 08:19 PM
gregzo
No problem :) Can you tick it for me?
Jul 31 '12 at 08:49 PM
whydoidoit
Oups, yep!
Jul 31 '12 at 11:35 PM
gregzo
(comments are locked)
|
