P
Peter Schmitz
Hi everyone,
I've got the following problem: In my application I make use of two
ArrayList objects like this:
Public Sub Main()
LoadData()
End Sub
Public Function LoadData()
Dim list1 as new ArrayList()
[...Fill the arraylist...]
AnalyzeData(list1)
End Function
Public Function AnalyzeData(list1 as ArrayList)
Dim list2 as new ArrayList
list2 = list1
[...do stuff...]
list2.Clear()
End Function
Now, this code creates a major memory leak....calling GC.Collect() etc.
won't help. Can anyone tell me what happens, when I call list2 = list1 - is
the whole list copied, or just a pointer??
I know this is a stupid program structure, but for some reasons I have to
stick to it...:/
Greetings,
Peter
I've got the following problem: In my application I make use of two
ArrayList objects like this:
Public Sub Main()
LoadData()
End Sub
Public Function LoadData()
Dim list1 as new ArrayList()
[...Fill the arraylist...]
AnalyzeData(list1)
End Function
Public Function AnalyzeData(list1 as ArrayList)
Dim list2 as new ArrayList
list2 = list1
[...do stuff...]
list2.Clear()
End Function
Now, this code creates a major memory leak....calling GC.Collect() etc.
won't help. Can anyone tell me what happens, when I call list2 = list1 - is
the whole list copied, or just a pointer??
I know this is a stupid program structure, but for some reasons I have to
stick to it...:/
Greetings,
Peter