Inside of the user handler, list can be changed. And it could make crash.
Change-Id: Ib49bc110e826ff7b34b6c8bc2224b5006b1972ba
if (!found)
return;
+ LIST_DEL(&layer_commit_handler->link);
+
private_layer = layer_commit_handler->private_layer;
if (tdm_debug_module & TDM_DEBUG_COMMIT)
_pthread_mutex_lock(&private_display->lock);
}
- LIST_DEL(&layer_commit_handler->link);
free(layer_commit_handler);
_pthread_mutex_unlock(&private_display->lock);
if (tdm_debug_module & TDM_DEBUG_COMMIT)
TDM_INFO("handler(%p)", v);
+ LIST_DEL(&v->link);
+
if (v->func)
v->func(v->private_output, sequence, tv_sec, tv_usec, v->user_data);
- LIST_DEL(&v->link);
+
free(v);
}
_pthread_mutex_lock(&private_display->lock);
return;
}
+ LIST_DEL(&output_commit_handler->link);
+
if (tdm_debug_module & TDM_DEBUG_COMMIT) {
TDM_INFO("----------------------------------------- output(%d) committed", private_output->pipe);
TDM_INFO("handler(%p)", output_commit_handler);
_pthread_mutex_lock(&private_display->lock);
}
- LIST_DEL(&output_commit_handler->link);
free(output_commit_handler);
if (tdm_debug_module & TDM_DEBUG_COMMIT)
TDM_RETURN_IF_FAIL(vblank_info != NULL);
+ LIST_DEL(&vblank_info->link);
+
if (vblank_info->vblank)
tdm_vblank_destroy(vblank_info->vblank);
destroy_wait(w);
}
- LIST_DEL(&vblank_info->link);
free(vblank_info);
}
TDM_RETURN_IF_FAIL(output_info != NULL);
+ LIST_DEL(&output_info->link);
+
tdm_output_remove_change_handler(output_info->output,
_tdm_server_cb_output_change, output_info);
wl_resource_destroy(v->resource);
}
- LIST_DEL(&output_info->link);
free(output_info);
}
VWR("couldn't update sw timer");
}
+ LIST_DEL(&wait_info->link);
+ _tdm_vblank_valid_list_del(&wait_info->valid_link);
+
/* tv_sec & tv_usec shouldn't be zero. But sometimes they are zero in some hardware.
* We need to prohibit that last_time becomes zero because "last_time == 0" means
* that a tdm_vblank object is just created and doesn't have the first vblank event.
wait_info->func(private_vblank, TDM_ERROR_NONE, wait_info->target_seq,
tv_sec, tv_usec, wait_info->user_data);
- LIST_DEL(&wait_info->link);
- _tdm_vblank_valid_list_del(&wait_info->valid_link);
free(wait_info);
}