![]() |
Freeing Dynamic Arrays
Do you have to manually release memory allocated by creating a dynamic
array using ReDim? In other words, if I have the following code: ReDim Test(1000) For i = 0 To 1000 Test(i) = "test value " & i Next Do have I have set Test = Nothing to prevent a memory leak? Thanks, Dave |
Re: Freeing Dynamic Arrays
Firstly, arrays as you describe them are not "dynamic" - the VB.NET "Redim"
keyword simply creates a new array and copies the contents to it. When an array goes out of scope, it is marked for garbage collection, so you do not need to do anything. Peter "headware" <david.k.land@gmail.com> wrote in message news:a7e2fa67-a37b-4a98-bbda-ecf69bdcea04@56g2000hsm.googlegroups.com... > Do you have to manually release memory allocated by creating a dynamic > array using ReDim? In other words, if I have the following code: > > ReDim Test(1000) > For i = 0 To 1000 > Test(i) = "test value " & i > Next > > Do have I have set Test = Nothing to prevent a memory leak? > > Thanks, > Dave |
| All times are GMT. The time now is 08:24 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.