Icon View Incident Report

Serious Serious
Reported By: Rick Leffler
Reported On: 1/2/2011
For: Version 4.30 Build 2
# 3403 VCL Components Can Raise "Session Already Destroyed" in Delphi XE During Form/Data Module Destructor

I'm working on moving my app from Delphi 2010 and the prior build of DBISAM, to Delphi XE and the latest build of DBISAM. This app (when compiled under D2010 and the prior version of DBISAM) has been running without errors for few months now, but when compiled under XE with the newest DBISAM, I get the exception shown below when I exit the app.

Note: The application uses a data module named DM0 and this is where I have the main TDBISAMDatabase and TDBISAMEngine components connected to a local database on the C: drive. There is no physical TDBISAMSession component on the data module form so I've always assumed one was created automatically by default. Now, the exception shown below only happens if at runtime the user selects a menu item that effectively creates an instance of a different data module (DM2) that contains components of: TDBISAMSession (Name=SessionRemote; SessionName=SessionRemote; SessionType=stRemote) and TDBISAMDatabase (SessionName=SessionRemote) which connect to a remote database using an IP address.

1. new vcl forms application

2. drop DBISAMDatabase
2.1 - DatabaseName : myDB

3. drop DBISAMTable1
3.1  - Databasename : select myDB from drop-down

4. right click on tab "Close page" it closes and you can reopen
from project manager

25. drop DBISAMSession1

5.1 - set AutoSessionName : true

6. right click on tab "Close page" - you get IDE error
"Component already destroyed ..." (of if you close all or exit
from IDE you get the same)

Comments Comments and Workarounds
The workaround is to make sure that the TDBISAMSession component is first in the creation order, not last. To do this, right-click on the form/data module, select Creation Order, and then rearrange as appropriate.

Resolution Resolution
Fixed Problem on 3/14/2011 in version 4.30 build 3

Products Affected Products Affected
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard with Source