summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-07-24 11:33:21 -0400
committerChris Michael <cp.michael@samsung.com>2014-07-24 11:33:21 -0400
commit0001b6578360d50f864a60e22a4ee7ebbf2f22a8 (patch)
treed0033dfff2553f3295e3701341d18dda7103e0f0 /src/lib/ecore_drm/ecore_drm.c
parentab38ffd6edf2f61917bd90ecbc82c59df12904a0 (diff)
ecore-drm: Fix improper shutdown for error cases in ecore_drm_init
If an error occurs during ecore_drm_init, we need to cleanup things in the proper order. This fixes the case where ecore_event_shutdown and ecore_shutdown May Not have been called (in previous revision) due to the error conditions being out of order. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/ecore_drm/ecore_drm.c b/src/lib/ecore_drm/ecore_drm.c
index 6900e67229..79d2b7888e 100644
--- a/src/lib/ecore_drm/ecore_drm.c
+++ b/src/lib/ecore_drm/ecore_drm.c
@@ -67,7 +67,7 @@ ecore_drm_init(void)
67 eina_log_domain_level_set("ecore_drm", EINA_LOG_LEVEL_DBG); 67 eina_log_domain_level_set("ecore_drm", EINA_LOG_LEVEL_DBG);
68 68
69 /* get sd-login properties we need */ 69 /* get sd-login properties we need */
70 if (sd_pid_get_session(getpid(), &sid) < 0) goto log_err; 70 if (sd_pid_get_session(getpid(), &sid) < 0) goto sd_err;
71 71
72 /* try to init dbus */ 72 /* try to init dbus */
73 if (!_ecore_drm_dbus_init(sid)) goto dbus_err; 73 if (!_ecore_drm_dbus_init(sid)) goto dbus_err;
@@ -81,12 +81,13 @@ ecore_drm_init(void)
81udev_err: 81udev_err:
82 _ecore_drm_dbus_shutdown(); 82 _ecore_drm_dbus_shutdown();
83dbus_err: 83dbus_err:
84 ecore_event_shutdown(); 84 free(sid);
85 ecore_shutdown(); 85sd_err:
86 eina_log_domain_unregister(_ecore_drm_log_dom); 86 eina_log_domain_unregister(_ecore_drm_log_dom);
87 _ecore_drm_log_dom = -1; 87 _ecore_drm_log_dom = -1;
88 free(sid);
89log_err: 88log_err:
89 ecore_event_shutdown();
90 ecore_shutdown();
90 eina_shutdown(); 91 eina_shutdown();
91 return --_ecore_drm_init_count; 92 return --_ecore_drm_init_count;
92} 93}