2.7.2. Releasing the objects of the target connection mechanism

In a simple scenario, the release of the CADI target connection mechanism is not complex. It works in the reverse order of establishing a connection:

  1. The CADISimulation must be released for a clean disconnection. Depending on the shutdown parameter for the method, the simulation is kept alive or destroyed.

  2. The Release() method of CADISimulation is responsible for initiating the clean up of the existing CADI interfaces for a simulation shutdown.

    Additionally, the call must close any other connection to the simulation by issuing the corresponding simulation callbacks. After that it is guaranteed that all connections are removed, the simulation object and all of its members can be cleanly destroyed.

  3. If a CADI factory was used to instantiate a new simulation, the CADISimulationFactory class is next within the class hierarchy.

    As with the other CADI classes, it owns a Release() method but, as mentioned in Using GetSimulationFactories(), the factory can be immediately released after instantiating the required CADI simulation. It is not necessary to call Release() on the factory during shutdown.

  4. The last step in closing a connection is to release the CADI broker. After cleanly releasing all simulations and factories owned by the broker, the Release() method is only required to destroy the object it belongs to.

    It some cases, however, a broker might contain live and used members. It must ensure that any connected caller is cleanly disconnected from then and that its own members are destroyed.

Copyright © 2008-2010 ARM Limited. All rights reserved.ARM DUI 0444F