From: Sung-jae Park Date: Tue, 21 Jan 2014 02:38:30 +0000 (+0900) Subject: Do not check the state of handler (common). X-Git-Tag: accepted/tizen/generic/20140226.073644~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=b09c876582654358f9c433431873859b3e483efa;hp=caef340bd8550e1ae5b0735f5d1c65fc74d34208;p=platform%2Fframework%2Fweb%2Flivebox-viewer.git Do not check the state of handler (common). release pixmap can be called in the deleted callback. in that case, the handler has DELETE state. so the release pixmap function should not check the handler's state. Just we have to believe the user. who should use the valid handler. Change-Id: Icacb8aa80660534cd7c8ebdc88b56066fd50fa4a --- diff --git a/packaging/liblivebox-viewer.spec b/packaging/liblivebox-viewer.spec index b421cc5..1ea6f66 100644 --- a/packaging/liblivebox-viewer.spec +++ b/packaging/liblivebox-viewer.spec @@ -1,6 +1,6 @@ Name: liblivebox-viewer Summary: Library for developing the application -Version: 0.20.5 +Version: 0.20.6 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/livebox.c b/src/livebox.c index 44c55b4..344ae1e 100644 --- a/src/livebox.c +++ b/src/livebox.c @@ -3254,16 +3254,24 @@ EAPI int livebox_acquire_lb_pixmap(struct livebox *handler, ret_cb_t cb, void *d return lb_acquire_lb_pixmap(handler, cb, data); } +/*! + * \note + * Do not check the state of handler and common-handler. + * If this function is used in the deleted callback, + * the handler and common-handler's state would be DELETE + * if this function check the state of handles, + * user cannot release the pixmap. + */ EAPI int livebox_release_lb_pixmap(struct livebox *handler, int pixmap) { struct packet *packet; - if (!handler || pixmap == 0 || handler->state != CREATE) { + if (!handler || pixmap == 0 /* || handler->state != CREATE */ ) { ErrPrint("Handler is invalid [%d]\n", pixmap); return LB_STATUS_ERROR_INVALID; } - if (!handler->common || handler->common->state != CREATE) { + if (!handler->common /* || handler->common->state != CREATE */) { ErrPrint("Handler is invalid\n"); return LB_STATUS_ERROR_INVALID; } @@ -3380,16 +3388,24 @@ EAPI int livebox_lb_pixmap(const struct livebox *handler) return pixmap; } +/*! + * \note + * Do not check the state of handler and common-handler. + * If this function is used in the deleted callback, + * the handler and common-handler's state would be DELETE + * if this function check the state of handles, + * user cannot release the pixmap. + */ EAPI int livebox_release_pd_pixmap(struct livebox *handler, int pixmap) { struct packet *packet; - if (!handler || pixmap == 0 || handler->state != CREATE) { + if (!handler || pixmap == 0 /* || handler->state != CREATE */) { ErrPrint("Handler is invalid [%d]\n", pixmap); return LB_STATUS_ERROR_INVALID; } - if (!handler->common || handler->common->state != CREATE) { + if (!handler->common /* || handler-common->state != CREATE */) { ErrPrint("Handler is invalid\n"); return LB_STATUS_ERROR_INVALID; }