diff --git a/.pick_status.json b/.pick_status.json index efd32e5a448..ecae02a500c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1651,7 +1651,7 @@ "description": "egl: set TSD as NULL after deinit", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c index 27b09fc4623..3a82a2d0d77 100644 --- a/src/egl/main/eglcurrent.c +++ b/src/egl/main/eglcurrent.c @@ -131,8 +131,14 @@ _eglCreateThreadInfo(void) static void _eglDestroyThreadInfo(_EGLThreadInfo *t) { - if (t != &dummy_thread) + if (t != &dummy_thread) { free(t); +#ifdef USE_ELF_TLS + /* Reset the TLS also here, otherwise + * it will be having a dangling pointer */ + _egl_TLS = NULL; +#endif + } }