ecore_device: initialize _ecore_devices to null in ecore_shutdown 85/214185/3
authorYeongjong Lee <yj34.lee@samsung.com>
Thu, 19 Sep 2019 01:03:40 +0000 (10:03 +0900)
committerYeongJong Lee <yj34.lee@samsung.com>
Thu, 19 Sep 2019 05:22:28 +0000 (05:22 +0000)
commit978a27f503f511bc44d62a40175cb384bf44197a
treeecd2d3373dcd6aa71973657310fb3c920487c1c9
parentd8337843c2ded2868ba93a207c072de4b910ec1a
ecore_device: initialize _ecore_devices to null in ecore_shutdown

eina_list will be freed in ecore_shutdown(eina_shutdown). if `_ecore_devices` is
used agian without being initialized to null after being freed, unexpected error
will occur. see example code. `ecore_device_add` is called during
`ecore_evas_new`.

```

static Ecore_Evas *ee = NULL;

static Eina_Bool
_timer_cb(void *data)
{
   ecore_main_loop_quit();
   return EINA_FALSE;
}

static void
setup(void)
{
   ecore_evas_init();

   ee = ecore_evas_new(NULL, 0, 0, 480, 200, NULL);

   ecore_timer_add(0.1, _timer_cb, NULL);
   ecore_main_loop_begin();
}

static void
teardown(void)
{
   if (ee != NULL)
     {
        ecore_evas_free(ee);
     }
   ecore_evas_shutdown();
}

int
main(int argc, const char **argv)
{
   setup();
   teardown();
   setup();
   teardown();
   return 0;
}
```

@tizen_fix

Change-Id: I9add945ec8184af2e0ed6b9ff4a84a62861710ac
src/lib/ecore/ecore.c
src/lib/ecore/ecore_device.c
src/lib/ecore/ecore_private.h