Forum > General
program locks up using setlength(array,n) on Packed Array of byte
dieselnutjob:
Hi
I have a program that's locking up (this bit of code is buried deep in a thread so I don't exactly know how) when I invoke setlength on a variable length array.
The definition is:-
ABlock: Packet Array of byte;
Previously in the code the length is set to zero.
When I do setlength(ABlock,n) it locks up, and if I remove that one line, it doesn't.
It seems to be specific to fpc 3.0.4 an MacOS
Anyone got any ideas why?
thanks
PascalDragon:
Without more code it's hard to tell. Can the variable be accessed from different threads at the same time?
dieselnutjob:
The array is only touched in the one thread.
440bx:
Is ABlock in a "var" section or in a "const" section ?
if it happens to be in a "const" section that might be the cause.
dieselnutjob:
it's in a var section immediately after "implementation"
Navigation
[0] Message Index
[#] Next page