Garbage Collection issue

G

Guest

I lose reference to an object when inside a 2 line For loop. I am
transfering data from one buffer to another buffer. It works fine the first
6 times the For loop is executed and completed. I am transfering data from
an unsigned char*__gc [2060]type to a global unsigned char* [2060] type.
Evidently garbage collection comes along and destroys one of my buffers when
I am using it. Is this ridiculous! I read somewhere that a programmer
doesn't need to know anything about garbage collection. I am transferring
only 2K of data at a time. How do I solve this problem. I tried to delete
and recreate the variable (new) each time before the for loop, and even tried
to use a pin pointer on the character pointer, but that didn't work. I am
not much of a programmer, so could someone give me a detailed fix to this
problem?
 
B

Barry Kelly

eric said:
I lose reference to an object when inside a 2 line For loop. [...]
How do I solve this problem. [...] I am
not much of a programmer, so could someone give me a detailed fix to this
problem?

It would be very helpful if you could post some simple (even better:
standalone) code that demonstrates the problem.
I read somewhere that a programmer
doesn't need to know anything about garbage collection.

You read wrong, IMHO.

-- Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top