From 0faaf7b7b5d8275aff4cfb89312a3a3e94dbd96d Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Thu, 10 Jan 2013 14:06:46 +0000 Subject: [PATCH] Do not try to get the genlist Smart_Data from the data pointer in show_region_hook, but rather get it from the actual Object. Fixes a crash that happens if someone overrides the show_region_hook (via elm_widget call) and passes an Int or String or something else as the data parameter. Signed-off-by: Christopher Michael SVN revision: 82571 --- src/lib/elm_genlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 176da80..f89bf51 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -2528,12 +2528,12 @@ _elm_genlist_smart_theme(Eo *obj, void *_pd EINA_UNUSED, va_list *list) /* FIXME: take off later. maybe this show region coords belong in the * interface (new api functions, set/get)? */ static void -_show_region_hook(void *data, +_show_region_hook(void *data EINA_UNUSED, Evas_Object *obj) { Evas_Coord x, y, w, h; - ELM_GENLIST_DATA_GET(data, sd); + ELM_GENLIST_DATA_GET_OR_RETURN(obj, sd); elm_widget_show_region_get(obj, &x, &y, &w, &h); //x & y are screen coordinates, Add with pan coordinates @@ -4624,7 +4624,7 @@ _elm_genlist_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE); elm_widget_can_focus_set(obj, EINA_TRUE); - elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj); + elm_widget_on_show_region_hook_set(obj, _show_region_hook, NULL); priv->generation = 1; -- 2.7.4