Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: dbExpress: Memory crash on dll when close application



Permlink Replies: 1 - Last Post: Feb 23, 2015 1:00 PM Last Post By: Jeff Overcash (...
Guest
dbExpress: Memory crash on dll when close application
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2015 2:18 PM
hi everyone

i have a simple dll project with a form, inside i have few components: one TDBGrid, one TClientDataSet with data created, one TFrxReport, one TfrxDBXComponents, one TfrxDesigner and one TSQLConnection

i have set connection to an ORACLE database to the TSQLConnection. i'm using TFrxReport for editing a template with DBX components inside, it works perfectly,

the ploblem occurs when i close the form,

First chance exception at $0497B447. Exception class $C0000005 with message 'access violation at 0x0497b447: read of address 0x00000010'. Process Ejecutable.exe (7664)

when i press the break button on delphi debbuger, breaks on the next code

unit Data.DBXCommon;
 
procedure TDBXDriver.RemoveReference;
begin
  TDBXDriverRegistry.DBXDriverRegistry.FDrivers.LockList;
  try
    dec(FReferenceCount);
    if FReferenceCount < 1 then
      TDBXDriverRegistry.DBXDriverRegistry.FreeDriver(Self);
  finally
    TDBXDriverRegistry.DBXDriverRegistry.FDrivers.UnLockList;
  end;
end;


if i test this code in a application project, works fine, but i need this works on my dll

i hope you can bring some help

regards from Colombia
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: dbExpress: Memory crash on dll when close application
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 23, 2015 1:00 PM   in response to: Guest in response to: Guest
Erik Ferney Cubillos GarcĂ­a wrote:
hi everyone

i have a simple dll project with a form, inside i have few components: one TDBGrid, one TClientDataSet with data created, one TFrxReport, one TfrxDBXComponents, one TfrxDesigner and one TSQLConnection

i have set connection to an ORACLE database to the TSQLConnection. i'm using TFrxReport for editing a template with DBX components inside, it works perfectly,

the ploblem occurs when i close the form,

First chance exception at $0497B447. Exception class $C0000005 with message 'access violation at 0x0497b447: read of address 0x00000010'. Process Ejecutable.exe (7664)

when i press the break button on delphi debbuger, breaks on the next code

unit Data.DBXCommon;
 
procedure TDBXDriver.RemoveReference;
begin
  TDBXDriverRegistry.DBXDriverRegistry.FDrivers.LockList;
  try
    dec(FReferenceCount);
    if FReferenceCount < 1 then
      TDBXDriverRegistry.DBXDriverRegistry.FreeDriver(Self);
  finally
    TDBXDriverRegistry.DBXDriverRegistry.FDrivers.UnLockList;
  end;
end;


if i test this code in a application project, works fine, but i need this works on my dll

i hope you can bring some help

regards from Colombia

Make sure your dll and exe are compile with run time packages. If not you have
multiple singleton objects out there, one for the EXE and one for the DLL.

Better yet use packages. They were designed to solve this problem. Build app
and packages with run time packages and everything is good to go.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted corridors of Whitehall.
(Fish)

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02