ecore evas drm - fix multi-dlopening of lib into symbol space

only load libglapi once... not multiple times by storing static ptr to
lib handle.

fix CID 1402692
This commit is contained in:
Carsten Haitzler 2019-08-05 13:48:14 +01:00
parent f2b1f312a9
commit 9ea4bb8fc7
1 changed files with 3 additions and 1 deletions

View File

@ -1136,7 +1136,9 @@ ecore_evas_drm_new_internal(const char *device, unsigned int parent EINA_UNUSED,
EAPI Ecore_Evas *
ecore_evas_gl_drm_new_internal(const char *device, unsigned int parent EINA_UNUSED, int x, int y, int w, int h)
{
dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
static void *libglapi = NULL;
if (!libglapi) libglapi = dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
if (dlerror()) return NULL;
return _ecore_evas_new_internal(device, x, y, w, h, EINA_TRUE);