Memory leak in Delphi XE3 when error happens on inserting into sqlite db Memory leak in Delphi XE3 when error happens on inserting into sqlite db sqlite sqlite

Memory leak in Delphi XE3 when error happens on inserting into sqlite db


I run tests with dbXpress SQLite and MySQL driver (XE3) and your code just leaks with SQLite (also get the double exception in debug mode) but it doesn't with MySQL.

IMHO this is a bug that should be reported to QC.

Stack Trace at first exception occurrence in debugger

:769cc41f KERNELBASE.RaiseException + 0x58Data.DBXCommon.TDBXContext.Error(???,'column title is not unique')Data.DbxSqlite.CheckError(19,???,$2F12738)Data.DbxSqlite.TDBXSqliteCommand.DerivedExecuteQueryData.DBXCommon.TDBXCommand.ExecuteQueryData.DBXCommon.TDBXMorphicCommand.ExecuteQueryData.SqlExpr.TCustomSQLDataSet.ExecuteStatementData.SqlExpr.TCustomSQLDataSet.ExecSQL(???)Data.SqlExpr.TSQLQuery.ExecSQL(???)Main_ViewU.TForm1.RunQuery($2E7B870,'Title',10)Main_ViewU.TForm1.Button1Click($2E85AD0)

Stack Trace at second exception occurrence in debugger

:769cc41f KERNELBASE.RaiseException + 0x58    // <-- Exception interrupts DestroyData.DBXCommon.TDBXContext.Error(???,'column title is not unique')Data.DbxSqlite.CheckError(19,???,$2F12738)Data.DbxSqlite.TDBXSqliteCommand.DerivedCloseData.DBXCommon.TDBXCommand.CloseData.DBXCommon.TDBXMorphicCommand.DerivedCloseData.DBXCommon.TDBXCommand.CloseData.DBXCommon.TDBXCommand.Destroy            // <-- DESTROYData.DBXCommon.TDBXMorphicCommand.Destroy     // <-- DESTROYSystem.TObject.FreeData.SqlExpr.TCustomSQLDataSet.CloseStatementData.SqlExpr.TCustomSQLDataSet.InternalFreeCommandData.SqlExpr.TCustomSQLDataSet.FreeCommandData.SqlExpr.TCustomSQLDataSet.ExecSQL(???)Data.SqlExpr.TSQLQuery.ExecSQL(???)Main_ViewU.TForm1.RunQuery($2E7B870,'Title',10)Main_ViewU.TForm1.Button1Click($2E85AD0)

And that causes the Memory Leak ...