Uno/Cpp/Tutorials/Global References
Using global references in C++ Uno and how they interfere with "atexit".
C++ Standard
In section 3.6.3. the C++ standard states, that the d'tors of values with "static storage duration" are called in the reverse order of the completion of their construction. It also states, that functions registered with "atexit" are called in some specified order wrt these kind of values, in fact they are called after all values have been destructed which had not been constructed at the time of registration. As "atexit" is called at program termination, this is relevant for termination.
In practice this leads to the situation, that values with "static storage duration" of dynamically loaded libraries may already be destroyed, even the library has not been closed yet.
Uno Objects
As a client of some service or object typically does not (should not) know, if the particular object is implemented in another library or uses globals for its implementation, any global references to Uno objects need to be cleared before termination.
Links
- Win32 "FreeLibrary" - http://msdn2.microsoft.com/en-us/library/ms683152.aspx