What causes "List index out of bounds" error when leaving the IDE???

I have an application written in Delphi 4 C/S version that uses Oracle.
When I shut the IDE down, sometimes I get a series of three error

1) List index out of bounds(4)

2) Exception EStringListError in Module Corlde40.bpl at 0003F806. List
index out of bounds(-1)

3) Database Engine Error: delphi32.exe
    The instruction at "0x40008534" referenced memory at "0x40008534".
The memory could not be
    "read".  Click on OK to terminate the application.

In an effort to try to find out what was causing this I would close one
of the files I had open in the IDE and then shut Delphi down.  I found
the number in error #1 above (the 4) was equal to the number of TQueries
I had open in the IDE.  As I close these the number deceased to 3,2,1.
When they were all closed I no longer got the errors.

To double check I reopened the TQueries in the IDE and then shut Delphi
down, but this did not cause the errors to reappear.  I tried running
the app and then shutting down Delphi and the errors reappeared once but
I haven't been able to get them consistently.

Any ideas on what causes this?  I hate to blindly be ignoring these
error messages although they don't appear to be effecting anything.

Thanks, Alan