Windows: Function loading issue.
The Win32 version of GetProcAddr looks like this:
void* p = wglGetProcAddress(function_name); if (p) return p; HMODULE h = LoadLibraryA("opengl32.dll"); return GetProcAddress(h, function_name); }}}
This is a clever way to get around the fact that wglGetProcAddress will not return an address for core OpenGL functions. The problem is this: Windows keeps an internal reference count for loaded DLLs. Every time you call LoadLibraryA, you will bump this reference count. Considering how many functions are in GL 1.1, that could be quite a lot.
Unless you properly release this reference count with FreeLibraryA, you will basically make it very difficult for any user who tries to load the OpenGL32.dll library dynamically rather than statically.