summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-08-10 16:45:12 +0800
committerBrian Paul <brianp@vmware.com>2009-08-11 22:14:35 -0600
commit64e7bb326207df559b5cebdb278f62df83cf1425 (patch)
tree3a30ae4d91b65757dced4b6f4e599b6a6c9180ed /src/egl
parent435c7ac24d8d6f8ddae59f4b66983d7642250d1e (diff)
downloadexternal_mesa3d-64e7bb326207df559b5cebdb278f62df83cf1425.zip
external_mesa3d-64e7bb326207df559b5cebdb278f62df83cf1425.tar.gz
external_mesa3d-64e7bb326207df559b5cebdb278f62df83cf1425.tar.bz2
egl: Use _eglAddAtExitCall to free thread infos and displays.
Thread infos and displays are usually not freed by applications. This commit add atexit calls to free them. Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/main/eglcurrent.c5
-rw-r--r--src/egl/main/egldisplay.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index f92719c..4431f96 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -4,6 +4,7 @@
#include "eglcontext.h"
#include "egllog.h"
#include "eglmutex.h"
+#include "eglglobals.h"
/* This should be kept in sync with _eglInitThreadInfo() */
@@ -84,7 +85,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
return EGL_FALSE;
}
_egl_FreeTSD = dtor;
- (void) _eglFiniTSD;
+ _eglAddAtExitCall(_eglFiniTSD);
_egl_TSDInitialized = EGL_TRUE;
}
@@ -118,7 +119,7 @@ static INLINE EGLBoolean _eglInitTSD(void (*dtor)(_EGLThreadInfo *))
{
if (!_egl_FreeTSD && dtor) {
_egl_FreeTSD = dtor;
- (void) _eglFiniTSD;
+ _eglAddAtExitCall(_eglFiniTSD);
}
return EGL_TRUE;
}
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 6fdb3b7..feae1d6 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -67,7 +67,7 @@ _eglInitDisplay(void)
_eglDisplayHash = _eglNewHashTable();
_eglSurfaceHash = _eglNewHashTable();
- (void) _eglFiniDisplay;
+ _eglAddAtExitCall(_eglFiniDisplay);
}
_eglUnlockMutex(&_eglDisplayInitMutex);