summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
1859dd4)
Fix Window Manager crush when applicaiton terminated
caused by wrong handling of sd_event_source.
v2. Add error check just in case
Bug-AGL: SPEC-1696
Change-Id: I639a60015cde46fca6bc5a3f6e8037afd8d79330
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
int PolicyManager::setStateTransitionProcessToSystemd(int event_id, uint64_t delay_ms, std::string role)
{
int PolicyManager::setStateTransitionProcessToSystemd(int event_id, uint64_t delay_ms, std::string role)
{
+ struct sd_event_source *event_source;
HMI_DEBUG("wm:pm", "event_id:0x%x delay:%d role:%s", event_id, delay_ms, role.c_str());
HMI_DEBUG("wm:pm", "event_id:0x%x delay:%d role:%s", event_id, delay_ms, role.c_str());
- // Store requested role
- this->req_role_list[event_id] = role;
-
- int ret = sd_event_add_defer(afb_daemon_get_event_loop(), NULL,
+ int ret = sd_event_add_defer(afb_daemon_get_event_loop(), &event_source,
&pm::transitionStateWrapper, new int(event_id));
if (0 > ret)
{
HMI_ERROR("wm:pm", "Faild to sd_event_add_defer: errno:%d", ret);
&pm::transitionStateWrapper, new int(event_id));
if (0 > ret)
{
HMI_ERROR("wm:pm", "Faild to sd_event_add_defer: errno:%d", ret);
- this->req_role_list.erase(event_id);
{
// Get current time
struct timespec time_spec;
{
// Get current time
struct timespec time_spec;
- clock_gettime(CLOCK_MONOTONIC, &time_spec);
+ clock_gettime(CLOCK_BOOTTIME, &time_spec);
// Calculate timer fired time
uint64_t usec = (time_spec.tv_sec * 1000000) + (time_spec.tv_nsec / 1000) + (delay_ms * 1000);
// Set timer
// Calculate timer fired time
uint64_t usec = (time_spec.tv_sec * 1000000) + (time_spec.tv_nsec / 1000) + (delay_ms * 1000);
// Set timer
- struct sd_event_source *event_source;
int ret = sd_event_add_time(afb_daemon_get_event_loop(), &event_source,
int ret = sd_event_add_time(afb_daemon_get_event_loop(), &event_source,
- CLOCK_MONOTONIC, usec, 1,
+ CLOCK_BOOTTIME, usec, 1,
&pm::timerEventWrapper, new int(event_id));
if (0 > ret)
{
HMI_ERROR("wm:pm", "Faild to sd_event_add_time: errno:%d", ret);
&pm::timerEventWrapper, new int(event_id));
if (0 > ret)
{
HMI_ERROR("wm:pm", "Faild to sd_event_add_time: errno:%d", ret);
- this->req_role_list.erase(event_id);
-
- // Store event source
- this->event_source_list[event_id] = event_source;
+ // Store event source
+ this->event_source_list[event_id] = event_source;
+ // Store requested role
+ this->req_role_list[event_id] = role;
{
bool found;
auto const &surface_id = this->lookup_id(act.role.c_str());
{
bool found;
auto const &surface_id = this->lookup_id(act.role.c_str());
+ if(surface_id == nullopt)
+ {
+ goto proc_remove_request;
+ }
std::string appid = g_app_list.getAppID(*surface_id, act.role, &found);
if (!found)
{
std::string appid = g_app_list.getAppID(*surface_id, act.role, &found);
if (!found)
{