[fpc-pascal] Reproducible code: DLL calling Firebird crashes

Reinier Olislagers reinierolislagers at gmail.com
Mon Sep 29 10:32:40 CEST 2014


Apparently my crashes in a dll that use Firebird have to do with
initialization sections in my business layer creating a single instance
of my db layer.

Distilled reproducible code that demonstrates problem:
https://bitbucket.org/reiniero/fpc_laz_patch_playground/downloads/dllcrash.zip

1. Please update your Firebird server details in dbinterface.pas to your
situation (hostname etc)
2. In businesslayer.pas, $define CRASH to see the problem.
The code in question is:
initialization
  DBLayer:=TDBInterface.Create;

finalization
  DBLayer.Free;
... so probably initialization order plays a part?!?

How should I fix this?

Thanks,
Reinier



More information about the fpc-pascal mailing list