summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldriver.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2010-12-22 21:12:24 +0100
committerChristian König <[email protected]>2010-12-22 21:12:24 +0100
commite179a8bf34022c200deee92d328cb1bae3c3aa4a (patch)
tree4c67616380e7c0efa2d7ff0fe67fd18af2fa11ad /src/egl/main/egldriver.c
parent1b03996b1269fb8b2f89e0a013d8427da660ff83 (diff)
parent38c8b034e2775640c588711290c244632dcc2475 (diff)
Merge remote branch 'origin/master' into pipe-video
Diffstat (limited to 'src/egl/main/egldriver.c')
-rw-r--r--src/egl/main/egldriver.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index ff0011c4b15..e5d8a39a4c8 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -186,11 +186,22 @@ _eglLoadModule(_EGLModule *mod)
static void
_eglUnloadModule(_EGLModule *mod)
{
+#if defined(_EGL_OS_UNIX)
/* destroy the driver */
if (mod->Driver && mod->Driver->Unload)
mod->Driver->Unload(mod->Driver);
+
+ /*
+ * XXX At this point (atexit), the module might be the last reference to
+ * libEGL. Closing the module might unmap libEGL and give problems.
+ */
+#if 0
if (mod->Handle)
close_library(mod->Handle);
+#endif
+#elif defined(_EGL_OS_WINDOWS)
+ /* XXX Windows unloads DLLs before atexit */
+#endif
mod->Driver = NULL;
mod->Handle = NULL;
@@ -670,12 +681,7 @@ _eglUnloadDrivers(void)
{
/* this is called at atexit time */
if (_eglModules) {
-#if defined(_EGL_OS_UNIX)
_eglDestroyArray(_eglModules, _eglFreeModule);
-#elif defined(_EGL_OS_WINDOWS)
- /* XXX Windows unloads DLLs before atexit */
- _eglDestroyArray(_eglModules, NULL);
-#endif
_eglModules = NULL;
}
}