[all] fix numerous memory leaks at application shutdown

This commit is contained in:
Geoffrey McRae
2021-01-24 19:39:00 +11:00
parent 086f73721d
commit 4c1893fe20
5 changed files with 81 additions and 13 deletions

View File

@@ -242,6 +242,16 @@ void egl_deinitialize(void * opaque)
LG_LOCK_FREE(this->lock);
eglMakeCurrent(this->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (this->frameContext)
eglDestroyContext(this->display, this->frameContext);
if (this->context)
eglDestroyContext(this->display, this->context);
eglTerminate(this->display);
free(this);
}

View File

@@ -154,8 +154,12 @@ void egl_splash_free(EGL_Splash ** splash)
if (!*splash)
return;
egl_model_free(&(*splash)->bg );
egl_model_free(&(*splash)->logo);
egl_shader_free(&(*splash)->bgShader );
egl_shader_free(&(*splash)->logoShader);
free(*splash);
*splash = NULL;
}
@@ -174,4 +178,4 @@ void egl_splash_render(EGL_Splash * splash, float alpha, float scaleY)
egl_model_render(splash->logo);
glDisable(GL_BLEND);
}
}