On 29/09/2014 17:41, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: >> On 29/09/2014 11:19, Mark Morgan Lloyd wrote: >>> Reinier Olislagers wrote: >>>> 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? >>> What happens if you move the responsibility for initialising and closing >>> the database connection to the app-level code? In other words, the app >>> does something like >> As the demo indicates, that does work (undefine CRASH). >> >> What I would like to know what is the cause of this problem - dlls being >> loaded before some kind - what kind? - of initialization is complete? >> >> Anyway, I'll keep digging; probably first looking at geting postgresql >> support in anyway. > > No, your example shows an implicit initialisation when the backend is > accessed. Agreed... but as that code works there's no reason to suspect your approach won't work & my finished program sucesfully uses your approach ;)
Re bug report: agreed. I'll raise it. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal