From: SooChan Lim Date: Thu, 24 Nov 2016 07:43:33 +0000 (+0900) Subject: use LIST_FOR_EACH_ENTRY_SAFE at _notify_emit X-Git-Tag: accepted/tizen/3.0/common/20161129.103252~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F99822%2F1;p=platform%2Fcore%2Fuifw%2Flibtbm.git use LIST_FOR_EACH_ENTRY_SAFE at _notify_emit The item->cb is the outside function of the libtbm. The tbm user may/can remove the item of the list, so we have to use the LIST_FOR_EACH_ENTRY_SAFE. Change-Id: Ib8ccbe0e1145f410001798a54535ee92d8dcc209 --- diff --git a/src/tbm_surface_queue.c b/src/tbm_surface_queue.c index ea5b09e..314bbe0 100644 --- a/src/tbm_surface_queue.c +++ b/src/tbm_surface_queue.c @@ -414,9 +414,14 @@ static void _notify_emit(tbm_surface_queue_h surface_queue, struct list_head *list) { - queue_notify *item = NULL; - - LIST_FOR_EACH_ENTRY(item, list, link) + queue_notify *item = NULL, *tmp;; + + /* + The item->cb is the outside function of the libtbm. + The tbm user may/can remove the item of the list, + so we have to use the LIST_FOR_EACH_ENTRY_SAFE. + */ + LIST_FOR_EACH_ENTRY_SAFE(item, tmp, list, link) item->cb(surface_queue, item->data); }