SDL_GL_UnloadLibrary problem?

Ive been playing around getting GLES/EGL driver working for my device.
Loading though SDL’s EGL internal code is fine but i had an issue where my GPU was not being shutdown properly. Which requires eglTerminate to be called and it was not.
Ive traced this back through to SDL_video’s SDL_GL_UnloadLibrary.

SDL_egl.c SDL_EGL_LoadLibraryOnly has:
_this->gl_config.driver_loaded = 1;

So I should at least have a 1.

SDL_video.c SDL_GL_LoadLibrary has:
if (retval == 0) {

Now I have a 2 and when i go to unload:

SDL_video.c then checks it in:
if (!_this) {
if (_this->gl_config.driver_loaded > 0) { // Im ok I have a 2
if (–_this->gl_config.driver_loaded > 0) { // Im not ok, now i have 1
if (_this->GL_UnloadLibrary) {

How is supposed to work for EGL/GLES? I could understand that is would make sense to unload the GLES library and then the EGL library, but in this case Im only really loading the EGL library and linking directly to the GLES library (in this case they are the same library file.)
Is that line in SDL_egl.c correct?