|Non-Confidential||PDF version||ARM 100963_0200_00_en|
|Home > Target Connection Mechanism > Disconnecting from a target > 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.
CADISimulationmust be released for a clean disconnection. Depending on the shutdown parameter for the method, the simulation is kept alive or destroyed.
Release() method of
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.
If a CADI factory was used to instantiate a new
CADISimulationFactory class is
next within the class hierarchy.
As with the other CADI classes, it owns a
but, as mentioned in 2.4 Using GetSimulationFactories(),
the factory can be immediately released after instantiating the required
CADI simulation. It is not necessary to call
the factory during shutdown.
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.