summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengwei Yang <chengwei.yang@intel.com>2013-10-29 14:16:22 +0800
committerChengwei Yang <chengwei.yang@intel.com>2013-10-29 14:16:22 +0800
commit68dbf2e3d528846b01cd2c1fa0a2735cc487a4d7 (patch)
treec8f581be01db3027ec06711333c578f2f0def3ed
parent1c51131aebc64774f5125a5fde65b6be1a58ae5a (diff)
downloadaul-1-68dbf2e3d528846b01cd2c1fa0a2735cc487a4d7.tar.gz
aul-1-68dbf2e3d528846b01cd2c1fa0a2735cc487a4d7.tar.bz2
aul-1-68dbf2e3d528846b01cd2c1fa0a2735cc487a4d7.zip
Fix: amd will crash if ecore_x_init() failed
if ecore_x_init() failed, then its internal variable _ecore_x_disp is NULL and will cause crash in _key_init(). Bug: https://bugs.tizen.org/jira/browse/PTREL-137 Change-Id: I116fca62b35cc38a7ff14036ecf726000770f4b0 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
-rwxr-xr-xam_daemon/amd_main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/am_daemon/amd_main.c b/am_daemon/amd_main.c
index 31ad99f6..4b29192b 100755
--- a/am_daemon/amd_main.c
+++ b/am_daemon/amd_main.c
@@ -256,11 +256,14 @@ static int __init()
.cg = NULL
};
+ int ret;
+
ecore_init();
evas_init();
ecore_event_init();
#ifdef X11
- ecore_x_init(NULL);
+ ret = ecore_x_init(NULL);
+ _D("ecore_x_init initialized %d times\n", ret);
#endif
#ifdef WAYLAND
ecore_wl_init(NULL);
@@ -273,7 +276,8 @@ static int __init()
_status_init(&amd);
#ifndef __emul__
- _key_init();
+ if (ret > 0)
+ _key_init();
#endif
if (vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVOPTION_BGPROCESS, __vconf_cb, NULL) != 0)
_E("Unable to register callback for VCONFKEY_SETAPPL_DEVOPTION_BGPROCESS\n");