Cannot remove obj from frame meta

oh i found the difference, instead of using l_obj = l_obj->next in for loop, you try to use NvDsMetaList *obj_next = l_obj->next. I also try it and it worked, but could you explain why it worked please although the two way is almost the same .