summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorAharon Hillel <a.hillel@partner.samsung.com>2011-10-25 09:51:38 +0000
committerTom Hacohen <tom@stosb.com>2011-10-25 09:51:38 +0000
commit262525a0af2d4b46c9ae2c96c658016d367c8d39 (patch)
tree69bd733d0536fe26c7bf9a21f15e23bad723662a /legacy
parent28053ef4554f571a9d6b73c273925a24a2f07aad (diff)
Elm glayer: Fixed memory leak, removed unused event list
Signed-off-by: Aharon Hillel <a.hillel@partner.samsung.com> SVN revision: 64381
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/elm_gesture_layer.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/legacy/elementary/src/lib/elm_gesture_layer.c b/legacy/elementary/src/lib/elm_gesture_layer.c
index b45b0c90b7..fa85f51dfa 100644
--- a/legacy/elementary/src/lib/elm_gesture_layer.c
+++ b/legacy/elementary/src/lib/elm_gesture_layer.c
@@ -251,7 +251,6 @@ struct _Widget_Data
251 Ecore_Timer *dbl_timeout; /* When this expires, dbl click/taps ABORTed */ 251 Ecore_Timer *dbl_timeout; /* When this expires, dbl click/taps ABORTed */
252 Eina_List *pending; /* List of devices need to refeed *UP event */ 252 Eina_List *pending; /* List of devices need to refeed *UP event */
253 Eina_List *touched; /* Information of touched devices */ 253 Eina_List *touched; /* Information of touched devices */
254 Eina_List *recent_device_event; /* Information of recent pe event of each device */
255 254
256 Eina_Bool repeat_events : 1; 255 Eina_Bool repeat_events : 1;
257}; 256};
@@ -336,64 +335,6 @@ _add_touched_device(Eina_List *list, Pointer_Event *pe)
336} 335}
337/* END - Functions to manage touched-device list */ 336/* END - Functions to manage touched-device list */
338 337
339/* START - Functions to manage recent device event list */
340/* This list holds the recent-event for each device */
341/* it will hold a single recent-event for each device */
342/* We are using those PE events of this list to */
343/* send them later to test funcs to restart gestures */
344/* We only keep DOWN, MOVE events in this list. */
345/* So when no touch this list is empty. */
346/**
347 * @internal
348 *
349 * Recoed Pointer Event in touched device list
350 * Note: This fuction allocates memory for PE event
351 * This memory is released here when device untouched
352 * or in cleanup.
353 * @param list Pointer to touched device list.
354 * @param Pointer_Event Pointer to PE.
355 *
356 * @ingroup Elm_Gesture_Layer
357 */
358static Eina_List *
359_add_recent_device_event(Eina_List *list, Pointer_Event *pe)
360{
361 void *data = eina_list_search_sorted(list, compare_device, pe);
362 Eina_List *l = list;
363 Pointer_Event *p = NULL;
364 if(data) /* First remove recent event for this device */
365 l = eina_list_remove(list, data);
366
367
368 switch(pe->event_type)
369 {
370 case EVAS_CALLBACK_MOUSE_DOWN:
371 case EVAS_CALLBACK_MOUSE_MOVE:
372 case EVAS_CALLBACK_MULTI_DOWN:
373 case EVAS_CALLBACK_MULTI_MOVE:
374 p = malloc(sizeof(Pointer_Event));
375 memcpy(p, pe, sizeof(Pointer_Event)); /* Freed in here or on cleanup */
376 l = eina_list_sorted_insert(l, compare_device, p);
377 break;
378
379 /* Kept those cases for referance */
380 case EVAS_CALLBACK_MOUSE_IN:
381 case EVAS_CALLBACK_MOUSE_OUT:
382 case EVAS_CALLBACK_MOUSE_WHEEL:
383 case EVAS_CALLBACK_MOUSE_UP:
384 case EVAS_CALLBACK_MULTI_UP:
385 case EVAS_CALLBACK_KEY_DOWN:
386 case EVAS_CALLBACK_KEY_UP:
387 break;
388
389 default:
390 return l;
391 }
392
393 return l;
394}
395/* END - Functions to manage recent device event list */
396
397/** 338/**
398 * @internal 339 * @internal
399 * 340 *
@@ -1117,9 +1058,6 @@ _del_hook(Evas_Object *obj)
1117 EINA_LIST_FREE(wd->touched, data) 1058 EINA_LIST_FREE(wd->touched, data)
1118 free(data); 1059 free(data);
1119 1060
1120 EINA_LIST_FREE(wd->recent_device_event, data)
1121 free(data);
1122
1123 if (!elm_widget_disabled_get(obj)) 1061 if (!elm_widget_disabled_get(obj))
1124 _unregister_callbacks(obj); 1062 _unregister_callbacks(obj);
1125 1063
@@ -3151,9 +3089,6 @@ _event_process(void *data, Evas_Object *obj __UNUSED__,
3151 } 3089 }
3152 } 3090 }
3153 3091
3154 /* Log event to restart gestures */
3155 wd->recent_device_event = _add_recent_device_event(wd->recent_device_event, &_pe);
3156
3157 /* we maintain list of touched devices */ 3092 /* we maintain list of touched devices */
3158 /* We also use move to track current device x.y pos */ 3093 /* We also use move to track current device x.y pos */
3159 if ((event_type == EVAS_CALLBACK_MOUSE_DOWN) || 3094 if ((event_type == EVAS_CALLBACK_MOUSE_DOWN) ||