ecore evas drm - fix code that forgets to del an fd handler

also.. note the badness of the code design mixing a global singleton
with a "per struct" set of data like fd handlers for the same devices
initted only once but... anyway. it's messy.
This commit is contained in:
Carsten Haitzler 2019-08-07 18:14:06 +01:00
parent 064b46b7a3
commit b6bc80d2da
1 changed files with 10 additions and 2 deletions

View File

@ -142,6 +142,8 @@ _drm_device_change(void *d EINA_UNUSED, int t EINA_UNUSED, void *event)
static int
_ecore_evas_drm_init(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata, const char *device)
{
// XXX: this is broken. we init once but in a per ecore evas struct so
// we assume there will be only 1 of these drm ecore evas's ever...
if (++_drm_init_count != 1) return _drm_init_count;
if (!ecore_drm2_init())
@ -206,8 +208,12 @@ _ecore_evas_drm_shutdown(Ecore_Evas_Engine_Drm_Data *edata)
ecore_job_del(edata->focus_job);
edata->focus_job = NULL;
}
ecore_drm2_outputs_destroy(edata->dev);
ecore_drm2_device_close(edata->dev);
if (edata->dev)
{
ecore_drm2_outputs_destroy(edata->dev);
ecore_drm2_device_close(edata->dev);
edata->dev = NULL;
}
ecore_drm2_shutdown();
ecore_event_evas_shutdown();
EINA_LIST_FREE(handlers, h)
@ -225,6 +231,8 @@ _drm_free(Ecore_Evas *ee)
edata = ee->engine.data;
canvases = eina_list_remove(canvases, ee);
ecore_main_fd_handler_del(edata->hdlr);
edata->hdlr = NULL;
_ecore_evas_drm_shutdown(edata);
free(edata);
}