In my Win32 single threaded application I support OpenGL rendering by dynamically loading a library explicitly linked to opengl32.lib a,d glu32.lib. I load and unload this utility library using LoadLibrary and FreeLibrary.
I’ve noticed that after the call to LoadLibary both opengl32.lib and glu32.lib are loaded, and on accessing opengl the ICD for the graphics card is also loaded. I can see this using the “Modules” view provided by Visual Studio 6.
However, when I call FreeLibrary (which returns no error or sets no error state), both opengl32.lib and glu32.lib are unloaded but the ICD remains. I have made sure that all rendering contexts are deleted before my call FreeLibrary.
When the app next comes to load my library I believe that the existence of the ICD is causing recource problems. Does anyone know if the ICD is unloaded only on the termination of the process, or if there is any way of forcing it to unload? I have found this behaviour with a number of different ICDs. Has anyone else noticed this behavour?