Re: AV when calling setlength on a dynamic array of boolean
- From: erewhon@xxxxxxxxxx (J French)
- Date: Fri, 24 Nov 2006 08:51:42 GMT
On 24 Nov 2006 00:03:09 -0800, nic@xxxxxx wrote:
Hey,
In an object I use a dynamic array of booleans to store some hardware
signals.
FSignalArray: array of Boolean;
When I initialise the object it reads from a database and calculates
those booleans. The first line of the initialising is
SetLength(FSignalArray, DBSize);
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?
I would guess that you have another problem and it is screwing up that
Array - SetLength is pretty reliable.
Make a copy of your App and start cutting out code.
Also turn on the bounds checking in the compiler
.
- Follow-Ups:
- References:
- Prev by Date: Re: AV when calling setlength on a dynamic array of boolean
- Next by Date: Re: AV when calling setlength on a dynamic array of boolean
- Previous by thread: Re: AV when calling setlength on a dynamic array of boolean
- Next by thread: Re: AV when calling setlength on a dynamic array of boolean
- Index(es):
Relevant Pages
|