Next: , Previous: Ada DLLs and Elaboration, Up: Building DLLs with gnatdll


G.11.4 Ada DLLs and Finalization

When the services of an Ada DLL are no longer needed, the client code should invoke the DLL finalization routine, if available. The DLL finalization routine is in charge of releasing all resources acquired by the DLL. In the case of the Ada code contained in the DLL, this is achieved by calling routine adafinal generated by the GNAT binder (see Binding with Non-Ada Main Programs). See the body of Finalize_Api for an example. As already pointed out the GNAT binder is automatically invoked during the DLL build process by the gnatdll tool (see Using gnatdll).