Icon View Incident Report

Serious Serious
Reported By: Simon Page
Reported On: 7/29/2004
For: Version 4.09 Build 1
# 1797 Executing Multiple INSERT, UPDATE, or DELETE Queries Can Cause a Memory Leak

I've been tracking down a memory leak and found that if you use a prepared query that updates, deletes or inserts with a sub-select more than once you will leak a TStringList assigned to FTransactionTables in TDataQuery, ie something like:

UpdateQuery.SQL.Add.. {Update delete or insert with sub-select SQL}
UpdateQuery.ExecSQL; /// Leaks here

This affects a lot of our code where we update items at regular intervals. The reason is that in dbisamsq at lines 7948, 8116 & 8321 (ExecuteSubSelectInsertQuery, ExecuteUpdateQuery & ExecuteDeleteQuery respectively) a new TStringList is created and assigned to FTransactionTables and for a prepared query when executing repeatedly this variable is already assigned.

Resolution Resolution
Fixed Problem on 7/29/2004 in version 4.10 build 1