bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0a2f066c2d299edef7b58cc663c7bd22616b344d

commit 0a2f066c2d299edef7b58cc663c7bd22616b344d
Author: Marcel Hollerbach <marcel-hollerb...@t-online.de>
Date:   Mon Jan 11 22:53:18 2016 +0100

    ecore_drm: close all devices in shutdown
---
 src/lib/ecore_drm/ecore_drm.c        | 16 +++++++++++++---
 src/lib/ecore_drm/ecore_drm_device.c | 10 ++++++++--
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_drm/ecore_drm.c b/src/lib/ecore_drm/ecore_drm.c
index 07b6a4f..36eff1c 100644
--- a/src/lib/ecore_drm/ecore_drm.c
+++ b/src/lib/ecore_drm/ecore_drm.c
@@ -108,15 +108,18 @@ log_err:
 
 /**
  * Shutdown the Ecore_Drm library.
- * 
+ *
  * @return  The number of times the library has been initialized without
  *          being shutdown. 0 is returned if an error occurs.
- * 
+ *
  * @ingroup Ecore_Drm_Init_Group
  */
-EAPI int 
+EAPI int
 ecore_drm_shutdown(void)
 {
+   Eina_List *lists;
+   Ecore_Drm_Device *dev;
+
    /* _ecore_drm_init_count should not go below zero. */
    if (_ecore_drm_init_count < 1)
      {
@@ -127,6 +130,13 @@ ecore_drm_shutdown(void)
    /* if we are still in use, decrement init count and get out */
    if (--_ecore_drm_init_count != 0) return _ecore_drm_init_count;
 
+   /* free the list of devices */
+   lists = eina_list_clone(ecore_drm_devices_get());
+   EINA_LIST_FREE(lists, dev)
+     {
+        ecore_drm_device_free(dev);
+     }
+
    _ecore_drm_inputs_shutdown();
 
    /* close eeze */
diff --git a/src/lib/ecore_drm/ecore_drm_device.c 
b/src/lib/ecore_drm/ecore_drm_device.c
index 1b7fc8b..a91af95 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -277,12 +277,18 @@ ecore_drm_device_free(Ecore_Drm_Device *dev)
         if (dev->dumb[i]) ecore_drm_fb_destroy(dev->dumb[i]);
         dev->dumb[i] = NULL;
      }
-
+   /* destroy all sprites*/
+   ecore_drm_sprites_destroy(dev);
+   /* clear inputs */
    ecore_drm_inputs_destroy(dev);
-
    /* free outputs */
    EINA_LIST_FREE(dev->outputs, output)
      ecore_drm_output_free(output);
+   /* disconnect launcher */
+   ecore_drm_launcher_disconnect(dev);
+   /* close myself */
+   ecore_drm_device_close(dev);
+
 
    /* free crtcs */
    if (dev->crtcs) free(dev->crtcs);

-- 


Reply via email to