summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-01-21 11:32:53 -0500
committerChris Michael <cpmichael@osg.samsung.com>2016-01-21 11:32:53 -0500
commit4ba349be4f6706d6049d54e1f60f2716c41edec5 (patch)
tree8acb19233bb151337af6bce20274564f6482c2a5 /src/lib/ecore_drm
parentcddc7ba445035040ee31685c1920327ca26f47d7 (diff)
ecore-drm: Destroy any existing eeze watch when we free the device
If a user frees a device without closing it we could end up with a dangling eeze watch. This small patch just makes sure to delete the watch if it exists @fix Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c
index a406d5e..cca3332 100644
--- a/src/lib/ecore_drm/ecore_drm_device.c
+++ b/src/lib/ecore_drm/ecore_drm_device.c
@@ -277,6 +277,8 @@ ecore_drm_device_free(Ecore_Drm_Device *dev)
277 dev->dumb[i] = NULL; 277 dev->dumb[i] = NULL;
278 } 278 }
279 279
280 if (dev->watch) eeze_udev_watch_del(dev->watch);
281
280 /* free crtcs */ 282 /* free crtcs */
281 if (dev->crtcs) free(dev->crtcs); 283 if (dev->crtcs) free(dev->crtcs);
282 284
@@ -394,9 +396,11 @@ ecore_drm_device_close(Ecore_Drm_Device *dev)
394 396
395 /* delete udev watch */ 397 /* delete udev watch */
396 if (dev->watch) eeze_udev_watch_del(dev->watch); 398 if (dev->watch) eeze_udev_watch_del(dev->watch);
399 dev->watch = NULL;
397 400
398 /* close xkb context */ 401 /* close xkb context */
399 if (dev->xkb_ctx) xkb_context_unref(dev->xkb_ctx); 402 if (dev->xkb_ctx) xkb_context_unref(dev->xkb_ctx);
403 dev->xkb_ctx = NULL;
400 404
401 _ecore_drm_launcher_device_close(dev->drm.name, dev->drm.fd); 405 _ecore_drm_launcher_device_close(dev->drm.name, dev->drm.fd);
402 406