Remove the grab from any lists Before we free it.

NB: Fixes Coverity CID 1039888

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-07-08 08:07:08 +01:00
parent c6db8ba782
commit 8280ef3730
1 changed files with 3 additions and 3 deletions

View File

@ -108,11 +108,11 @@ evas_object_grabs_cleanup(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected
while (obj->grabs)
{
Evas_Key_Grab *g = obj->grabs->data;
obj->layer->evas->grabs =
eina_list_remove(obj->layer->evas->grabs, g);
obj->grabs = eina_list_remove(obj->grabs, g);
if (g->keyname) free(g->keyname);
free(g);
obj->layer->evas->grabs = eina_list_remove(obj->layer->evas->grabs,
g);
obj->grabs = eina_list_remove(obj->grabs, g);
}
}
}