forked from enlightenment/efl
ecore_drm: close all devices in shutdown
This commit is contained in:
parent
093846aaea
commit
0a2f066c2d
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue