From: sanghyeok.oh Date: Mon, 5 Feb 2018 11:52:03 +0000 (+0900) Subject: haptic: watch/unwatch name with correct id X-Git-Tag: accepted/tizen/unified/20180206.064218^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F169290%2F1;p=platform%2Fcore%2Fsystem%2Ffeedbackd.git haptic: watch/unwatch name with correct id multiple haptic_info struct can be added into haptic_handle_list, but abnormal name watching id is assigned to one global variable, fix this to use correct id for each haptic_info struct Change-Id: Ia2360120bdbd6ca6bdcc47ad6e071a90f7f462f9 Signed-off-by: sanghyeok.oh --- diff --git a/src/core/dbus.c b/src/core/dbus.c index f21a073..42137a7 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -981,7 +981,14 @@ static int _dbus_handle_register_dbus_object(dbus_handle_h handle, const char *o goto err; } - _E("%s", buf); + /* todo: delete this */ +#if 0 + if (strlen(buf) <= 512) { + _E("%s", buf); + } else { + _E("%s", buf + strlen(buf) - 512); + } +#endif nodeinfo = g_dbus_node_info_new_for_xml(buf, &err); if (!nodeinfo || err) { diff --git a/src/haptic/haptic.c b/src/haptic/haptic.c index 4578fce..231e374 100644 --- a/src/haptic/haptic.c +++ b/src/haptic/haptic.c @@ -63,6 +63,7 @@ struct haptic_info { char *sender; dd_list *handle_list; + guint id_watch; }; struct vibrate_effect_info { @@ -196,7 +197,6 @@ void haptic_name_owner_changed(GDBusConnection *connection, remove_haptic_info(info); } -static guint id_name_watch; static struct haptic_info *add_haptic_info(const char *sender) { struct haptic_info *info; @@ -210,7 +210,7 @@ static struct haptic_info *add_haptic_info(const char *sender) info->sender = strdup(sender); DD_LIST_APPEND(haptic_handle_list, info); - id_name_watch = dbus_handle_watch_name(sender, NULL, haptic_name_owner_changed, info); + info->id_watch = dbus_handle_watch_name(sender, NULL, haptic_name_owner_changed, info); return info; } @@ -219,7 +219,7 @@ static int remove_haptic_info(struct haptic_info *info) { assert(info); - dbus_handle_unwatch_name(id_name_watch); + dbus_handle_unwatch_name(info->id_watch); DD_LIST_REMOVE(haptic_handle_list, info); DD_LIST_FREE_LIST(info->handle_list);