Re: AV when calling setlength on a dynamic array of boolean



nic@xxxxxx wrote:
and it works fine. However, when I stop running I can't do

SetLength(FSignalArray, 0);
or
FSignalArray:=nil;

If I do so, the program crashes with an invalid pointer operation or an
access violation.
If I remove that line it works fine, except that when I re-initialise
the object,

SetLength(FSignalArray, DBSize);

crashes with an access violation even though DBSize is unchanged. Still
using Delphi 6, what am I missing here?

The problem lies elsewhere. Everything you've shown here is correct.

Are you using the Move procedure? Are you calling any DLL function that you've declared yourself? Are you doing any pointer arithmetic?

--
Rob
.