[elm_colorpalette]: bug fix sending clicked in mouse up than mouse
authorshilpa singh <shilpa.singh@samsung.com>
Tue, 20 Dec 2011 11:00:17 +0000 (16:30 +0530)
committershilpa singh <shilpa.singh@samsung.com>
Tue, 20 Dec 2011 11:00:17 +0000 (16:30 +0530)
down to avoid any kind of crash which may happen if widget is deleted
in clicked callback.

src/lib/elm_colorpalette.c

index 3294c5b..2248f44 100644 (file)
@@ -92,21 +92,21 @@ static void _colorpalette_object_resize(void *data, Evas *e __UNUSED__, Evas_Obj
 
 static void _color_select_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
-   Elm_Colorpalette_Color *color;
    Colorpalette_Item *item = (Colorpalette_Item *) data;
-   color = ELM_NEW(Elm_Colorpalette_Color);
-   if (!color) return;
-   color->r = item->r;
-   color->g = item->g;
-   color->b = item->b;
-   evas_object_smart_callback_call(item->obj, "clicked", color);
    edje_object_signal_emit(elm_layout_edje_get(item->lo), "focus_visible", "elm");
 }
 
 static void _color_release_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
 {
+   Elm_Colorpalette_Color *color;
    Colorpalette_Item *item = (Colorpalette_Item *) data;
+   color = ELM_NEW(Elm_Colorpalette_Color);
+   if (!color) return;
+   color->r = item->r;
+   color->g = item->g;
+   color->b = item->b;
    edje_object_signal_emit(elm_layout_edje_get(item->lo), "focus_invisible", "elm");
+   evas_object_smart_callback_call(item->obj, "clicked", color);
 }
 
 static void _color_table_delete(Evas_Object *obj)