There's a special OpenGL context which is shared with all others. I must use a special one because only an inactive context can be shared.
There's a reference counter, managed by the GlResource base class, which controls the lifetime of this context.
So if you have a window, texture or font which is destroyed at global exit, this shared context will be destroyed at global exit as well. But this variable is managed in a thread-safe way, so it requires at least a mutex, global as well. I could force the mutex to be destroyed after the context, but that would require some ugly code and it's probably not the only problem (the context management code is rather complex).