AV when calling setlength on a dynamic array of boolean
- From: nic@xxxxxx
- Date: 24 Nov 2006 00:03:09 -0800
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?
.
- Follow-Ups:
- Re: AV when calling setlength on a dynamic array of boolean
- From: J French
- Re: AV when calling setlength on a dynamic array of boolean
- From: Rob Kennedy
- Re: AV when calling setlength on a dynamic array of boolean
- Prev by Date: Re: recursive treeview fill - problem
- Next by Date: Re: AV when calling setlength on a dynamic array of boolean
- Previous by thread: DBGrid scroll bars
- Next by thread: Re: AV when calling setlength on a dynamic array of boolean
- Index(es):
Relevant Pages
|