mirror of https://github.com/libsdl-org/SDL.git
testgles2: fix leaks
This commit is contained in:
parent
8a5d1fc196
commit
6f1136c6ce
|
|
@ -68,6 +68,7 @@ static SDL_GLContext *context = NULL;
|
||||||
static int depth = 16;
|
static int depth = 16;
|
||||||
static SDL_bool suspend_when_occluded;
|
static SDL_bool suspend_when_occluded;
|
||||||
static GLES2_Context ctx;
|
static GLES2_Context ctx;
|
||||||
|
static shader_data *datas;
|
||||||
|
|
||||||
static int LoadContext(GLES2_Context *data)
|
static int LoadContext(GLES2_Context *data)
|
||||||
{
|
{
|
||||||
|
|
@ -100,6 +101,7 @@ quit(int rc)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
SDL_free(datas);
|
||||||
if (context) {
|
if (context) {
|
||||||
for (i = 0; i < state->num_windows; i++) {
|
for (i = 0; i < state->num_windows; i++) {
|
||||||
if (context[i]) {
|
if (context[i]) {
|
||||||
|
|
@ -535,7 +537,6 @@ Render(unsigned int width, unsigned int height, shader_data *data)
|
||||||
|
|
||||||
static int done;
|
static int done;
|
||||||
static Uint32 frames;
|
static Uint32 frames;
|
||||||
static shader_data *datas;
|
|
||||||
#ifndef SDL_PLATFORM_EMSCRIPTEN
|
#ifndef SDL_PLATFORM_EMSCRIPTEN
|
||||||
static thread_data *threads;
|
static thread_data *threads;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -934,6 +935,7 @@ int main(int argc, char *argv[])
|
||||||
SDL_WaitThread(threads[i].thread, NULL);
|
SDL_WaitThread(threads[i].thread, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SDL_free(threads);
|
||||||
} else {
|
} else {
|
||||||
while (!done) {
|
while (!done) {
|
||||||
loop();
|
loop();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue