Saurabh Kumar said:
Ok Larry you win
I'd guess not. A SMALL demo means just what is needed to reproduce the
problem. That would have meant isolating the arraylist, the property and
adding a means to pass in an array. If you would have added that to a new
form, you could have passed the property an array from the click of a button,
and tested just that part of it, without all that other FTP code. Something like
that can be copy and pasted into a new form and ran. What you posted would
not run, so it did not reproduce the problem.
Isolating the problems to just their bare essentials will help you solve the
problems yourself! If you get stuck, only the problem code need be
posted, not a whole project, or class.
I have started a new thread with the class files attached as is for your
reference. The thread is called:
ByVal also seems to pass array ByRef
ByVal does not mean you get a copy of the array, it means you get a
copy of the pointer to the array. Both are references to the same array
and therein lies the problem. When you pass the same array into the
property, another reference to that same array is added to the arraylist.
No matter how many times you clear it and reload it with data, it is still
the same array sitting on the managed heap. What you want is a new
array instead of just clearing out the old data and filling it up with new
data.
Instead of:
m_aBuffer.Clear(m_aBuffer, 0, m_aBuffer.Length)
Try this:
ReDim m_aBuffer(BLOCK_SIZE)
LFS