Memory problem
-
Hanne Berthelsen
- Posts: 15
- Joined: Thu 18 Nov 2004 07:51
Memory problem
I am using MySQL Data Access Component (MyDAC) v. 4.00.1.6 / Borland C++ Builder 5
My application slowly "eats up memory" if regularly accessing a field that does not exist even though there is a try ... catch around accessing the nonexisting field.
try
{
GroupID = MyTable->FieldByName("GroupID")->AsInteger;
}
catch (...)
{
GroupID = 0;
}
Would it help to upgrade to latest version of MyDAC ?
My application slowly "eats up memory" if regularly accessing a field that does not exist even though there is a try ... catch around accessing the nonexisting field.
try
{
GroupID = MyTable->FieldByName("GroupID")->AsInteger;
}
catch (...)
{
GroupID = 0;
}
Would it help to upgrade to latest version of MyDAC ?
-
Hanne Berthelsen
- Posts: 15
- Joined: Thu 18 Nov 2004 07:51
We have thoroughly tested this problem. This is memory leak of C++Builder error handling system. It appears when handling exceptions that are raised from functions in dcu made by Delphi. It can be easily reproduced using ADO components instead of MyDAC or by calling
instead of
Code: Select all
DatabaseError("Some text");Code: Select all
GroupID = MyTable->FieldByName("GroupID")->AsInteger;-
Hanne Berthelsen
- Posts: 15
- Joined: Thu 18 Nov 2004 07:51
We can reproduce this problem in C++Builder 6 but not in Borland Developer Studio 2006. We have tested the solution you have sent us by e-mail. Changing
to
really helps to avoid the memory leak.
Code: Select all
catch (...) Code: Select all
catch (Exception &E) -
Hanne Berthelsen
- Posts: 15
- Joined: Thu 18 Nov 2004 07:51