summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-07 18:14:06 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-07 18:14:06 +0100
commitb6bc80d2da947b858a25a18ed2c084f6ae7e02cf (patch)
tree996ddf1d943ff4bc0be1d32ecb00bf280e383c84 /src/modules
parent064b46b7a3ab223c2453628d22ae80db5868b2c6 (diff)
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.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 7669fee535..35eadc002b 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -142,6 +142,8 @@ _drm_device_change(void *d EINA_UNUSED, int t EINA_UNUSED, void *event)
142static int 142static int
143_ecore_evas_drm_init(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata, const char *device) 143_ecore_evas_drm_init(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata, const char *device)
144{ 144{
145 // XXX: this is broken. we init once but in a per ecore evas struct so
146 // we assume there will be only 1 of these drm ecore evas's ever...
145 if (++_drm_init_count != 1) return _drm_init_count; 147 if (++_drm_init_count != 1) return _drm_init_count;
146 148
147 if (!ecore_drm2_init()) 149 if (!ecore_drm2_init())
@@ -206,8 +208,12 @@ _ecore_evas_drm_shutdown(Ecore_Evas_Engine_Drm_Data *edata)
206 ecore_job_del(edata->focus_job); 208 ecore_job_del(edata->focus_job);
207 edata->focus_job = NULL; 209 edata->focus_job = NULL;
208 } 210 }
209 ecore_drm2_outputs_destroy(edata->dev); 211 if (edata->dev)
210 ecore_drm2_device_close(edata->dev); 212 {
213 ecore_drm2_outputs_destroy(edata->dev);
214 ecore_drm2_device_close(edata->dev);
215 edata->dev = NULL;
216 }
211 ecore_drm2_shutdown(); 217 ecore_drm2_shutdown();
212 ecore_event_evas_shutdown(); 218 ecore_event_evas_shutdown();
213 EINA_LIST_FREE(handlers, h) 219 EINA_LIST_FREE(handlers, h)
@@ -225,6 +231,8 @@ _drm_free(Ecore_Evas *ee)
225 231
226 edata = ee->engine.data; 232 edata = ee->engine.data;
227 canvases = eina_list_remove(canvases, ee); 233 canvases = eina_list_remove(canvases, ee);
234 ecore_main_fd_handler_del(edata->hdlr);
235 edata->hdlr = NULL;
228 _ecore_evas_drm_shutdown(edata); 236 _ecore_evas_drm_shutdown(edata);
229 free(edata); 237 free(edata);
230} 238}