ecore_events: inarray should be flushed before return 01/140801/1
authorWooHyun Jung <wh0705.jung@samsung.com>
Wed, 26 Jul 2017 09:57:37 +0000 (18:57 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Wed, 26 Jul 2017 10:28:42 +0000 (19:28 +0900)
@fix

Change-Id: I59ab3ecc71899bdbdc5a08b1584251831d6433c9

src/lib/ecore/ecore_events.c

index e918fd7..6d8c092 100644 (file)
@@ -663,13 +663,13 @@ ecore_event_type_flush_internal(int type, ...)
    va_list args;
    Eina_Bool wrong_type = EINA_FALSE;
 
+   // In case of an empty list of event
+   if (type == ECORE_EVENT_NONE) return;
+
    eina_inarray_step_set(&types, sizeof (Eina_Inarray), sizeof (int), 4);
 
    eina_inarray_push(&types, &type);
 
-   // In case of an empty list of event
-   if (type == ECORE_EVENT_NONE) return;
-
    va_start(args, type);
    do
      {
@@ -688,7 +688,11 @@ ecore_event_type_flush_internal(int type, ...)
         wrong_type = EINA_TRUE;
      }
 
-   if (wrong_type) return ;
+   if (wrong_type)
+     {
+        eina_inarray_flush(&types);
+        return ;
+     }
 
    EINA_INLIST_FOREACH_SAFE((Eina_Inlist *) events, l, event)
      {