From bd2eafe208184dc1e01fb6d03c2fe1c47286abf0 Mon Sep 17 00:00:00 2001 From: cedric Date: Fri, 11 May 2012 10:28:02 +0000 Subject: [PATCH] eet: force closing all file on shutdown. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eet@70928 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ NEWS | 8 ++++++++ src/lib/eet_lib.c | 27 +++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6b5b7b8..26d4870 100644 --- a/ChangeLog +++ b/ChangeLog @@ -582,3 +582,7 @@ 2012-04-26 Carsten Haitzler (The Rasterman) 1.6.0 release + +2012-05-11 Cedric Bail + + * Force destruction of all pending file when shuting down eet. diff --git a/NEWS b/NEWS index 107a8b2..bff1bff 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +Eet 1.7.0 + +Changes since Eet 1.6.0: +-------------------------- + +Fixes: + * Force destruction of all pending file when shuting down eet. + Eet 1.6.0 Changes since Eet 1.5.0: diff --git a/src/lib/eet_lib.c b/src/lib/eet_lib.c index a356a2b..a3295f4 100644 --- a/src/lib/eet_lib.c +++ b/src/lib/eet_lib.c @@ -633,6 +633,33 @@ eet_shutdown(void) return eet_init_count; eet_clearcache(); + + if (eet_writers_num || eet_readers_num) + { + Eet_File **closelist = NULL; + int num = 0; + int i; + + closelist = alloca((eet_writers_num + eet_readers_num) + * sizeof(Eet_File *)); + for (i = 0; i < eet_writers_num; i++) + { + closelist[num++] = eet_writers[i]; + eet_writers[i]->delete_me_now = 1; + } + + for (i = 0; i < eet_readers_num; i++) + { + closelist[num++] = eet_readers[i]; + eet_readers[i]->delete_me_now = 1; + } + + for (i = 0; i < num; i++) + { + ERR("File '%s' is still open !", closelist[i]->path); + eet_internal_close(closelist[i], EINA_TRUE); + } + } eet_node_shutdown(); eet_mempool_shutdown(); -- 2.7.4