@wp I am using the Debugger but it does not show where the error occurs from. The Call stack is all weird. Still, if you saying that I'm trying to access values that are not assigned yet, I do have an idea now...
I use a ring buffer to update the chart. I get the values from some other thread, and I store them into the buffer. I get multiple variables in an array of bytes, work with them, write them into the ring buffer and after that, I clear the graph and write the new buffer in the graph. I do
List1.Clear;
for i := 0 to RingBuffer.Size - 1 do
List1.Add(CalculatedValue, RingBuffer.Data[i])Where RingBuffer is
type RingBuffer = Record
Size : integer;
WritePoint : integer;
ReadPoint : Integer;
Data : Array of Integer;
end;
What could be the problem? The graph tries to update itself right after the Clear and I try to write in the same time or what?
I use the ring Buffer because I want the chart to have the values of last X datas received from the other thread so, I write 5 datas into the ring buffer, update the chart and when the next data arrives, the oldest data in the Buffer is being overwritten...
@Arthurus, yes I am. Making it inactive will not help me. I need to clear it.
//Threads Sync and critical sections are used. I took this in consideration... It does not seem to be that...