egl: replace _egl_driver->Unload() callback with a simple free()
authorEric Engestrom <eric@engestrom.ch>
Tue, 26 Sep 2017 12:13:39 +0000 (13:13 +0100)
committerEric Engestrom <eric.engestrom@imgtec.com>
Thu, 12 Oct 2017 13:38:55 +0000 (14:38 +0100)
Bonus: fixes a memleak on haiku when unloading the driver

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/haiku/egl_haiku.cpp
src/egl/main/egldriver.c
src/egl/main/egldriver.h

index 171858bbcd95a438fd367d9a7698aaea0956fb61..5334384d2f560303e62004e2b3252078ab9c3a3f 100644 (file)
@@ -3178,14 +3178,6 @@ dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx,
    return dri2_dpy->interop->export_object(dri2_ctx->dri_context, in, out);
 }
 
-static void
-dri2_unload(_EGLDriver *drv)
-{
-   struct dri2_egl_driver *dri2_drv = dri2_egl_driver(drv);
-
-   free(dri2_drv);
-}
-
 static EGLBoolean
 dri2_load(_EGLDriver *drv)
 {
@@ -3272,7 +3264,6 @@ _eglBuiltInDriver(void)
    dri2_drv->base.API.DupNativeFenceFDANDROID = dri2_dup_native_fence_fd;
 
    dri2_drv->base.Name = "DRI2";
-   dri2_drv->base.Unload = dri2_unload;
 
    return &dri2_drv->base;
 }
index c17198d6dd805676a696b03364a8459ba4fa34a3..29ef7e854c77ff73d3c628f8dcb9bb6bac24cb13 100644 (file)
@@ -308,14 +308,6 @@ haiku_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
 }
 
 
-extern "C"
-void
-haiku_unload(_EGLDriver* drv)
-{
-
-}
-
-
 /**
  * This is the main entrypoint into the driver, called by libEGL.
  * Create a new _EGLDriver object and init its dispatch table.
@@ -347,7 +339,6 @@ _eglBuiltInDriver(void)
        driver->base.API.SwapBuffers = haiku_swap_buffers;
 
        driver->base.Name = "Haiku";
-       driver->base.Unload = haiku_unload;
 
        TRACE("API Calls defined\n");
 
index 1ede95ea6f4616becabb2ac708104451b85dfa58..5d5b7daa41811a601e8b0409246928c3c532c1e0 100644 (file)
@@ -120,8 +120,6 @@ void
 _eglUnloadDrivers(void)
 {
    /* this is called at atexit time */
-   if (_eglDriver && _eglDriver->Unload)
-      _eglDriver->Unload(_eglDriver);
-
+   free(_eglDriver);
    _eglDriver = NULL;
 }
index a8b0cab2b1aa8bcb1fac8ba07432cb9f32999cb2..fc27f1ffa3c84f559bba26b9e22305f6a2dea7a6 100644 (file)
@@ -80,13 +80,6 @@ struct _egl_driver
 {
    const char *Name;  /**< name of this driver */
 
-   /**
-    * Release the driver resource.
-    *
-    * It is called before dlclose().
-    */
-   void (*Unload)(_EGLDriver *drv);
-
    _EGLAPI API;  /**< EGL API dispatch table */
 };