Is there any way to accomplish the following in code:
It doesn't seem possible to do that currently, but this makes it difficult to write a clean interface to the library that handles initialization and shutdown.
I am looking also for an answer to the same question.
If mgExit() is called once any later call to mgInit() is not effective. We can't know what really happens because mgInit() has no return value !
My App calls other individual components where OpenFlight API is used, i.e. in each component there is a call to mgInit() and to mgExit().
The problem appears when my App calls a component which uses the OpenFlight API after a first component (also using the OpenFlight API) has been called. The mgInit() call in the second component is not effective after the call to mgExit() has taken place in the first component .
This is a limitation of the OpenFlight API. You cannot call mgInit more than one time per process. Others have gotten around this limitation by creating a wrapper interface to the API that can be init-ed / exit-ed at will but manages the mgInit and mgExit of the API under the hood.
Sorry about that.