forked from enlightenment/efl
Only run init when count is 1 and shutdown when count is 0
SVN revision: 16649
This commit is contained in:
parent
efe51da1dc
commit
b6ce3afdb5
|
@ -9,7 +9,7 @@ static int init = 0;
|
||||||
int
|
int
|
||||||
ecore_file_init()
|
ecore_file_init()
|
||||||
{
|
{
|
||||||
if (++init > 1) return init;
|
if (++init != 1) return init;
|
||||||
|
|
||||||
if (!ecore_file_monitor_init())
|
if (!ecore_file_monitor_init())
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -31,7 +31,7 @@ error:
|
||||||
int
|
int
|
||||||
ecore_file_shutdown()
|
ecore_file_shutdown()
|
||||||
{
|
{
|
||||||
if (--init > 0) return init;
|
if (--init != 0) return init;
|
||||||
|
|
||||||
ecore_file_monitor_shutdown();
|
ecore_file_monitor_shutdown();
|
||||||
ecore_file_path_shutdown();
|
ecore_file_path_shutdown();
|
||||||
|
|
|
@ -33,7 +33,7 @@ static fd_set _current_fd_set;
|
||||||
int
|
int
|
||||||
ecore_file_download_init(void)
|
ecore_file_download_init(void)
|
||||||
{
|
{
|
||||||
if (++init > 1) return init;
|
if (++init != 1) return init;
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
FD_ZERO(&_current_fd_set);
|
FD_ZERO(&_current_fd_set);
|
||||||
|
@ -56,7 +56,7 @@ ecore_file_download_init(void)
|
||||||
int
|
int
|
||||||
ecore_file_download_shutdown(void)
|
ecore_file_download_shutdown(void)
|
||||||
{
|
{
|
||||||
if (--init > 0) return init;
|
if (--init != 0) return init;
|
||||||
#ifdef HAVE_CURL
|
#ifdef HAVE_CURL
|
||||||
Ecore_File_Download_Job *job;
|
Ecore_File_Download_Job *job;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ static Ecore_File_Monitor_Type monitor_type = ECORE_FILE_MONITOR_TYPE_NONE;
|
||||||
int
|
int
|
||||||
ecore_file_monitor_init(void)
|
ecore_file_monitor_init(void)
|
||||||
{
|
{
|
||||||
if (++init > 1) return init;
|
if (++init != 1) return init;
|
||||||
|
|
||||||
#ifdef HAVE_INOTIFY
|
#ifdef HAVE_INOTIFY
|
||||||
monitor_type = ECORE_FILE_MONITOR_TYPE_INOTIFY;
|
monitor_type = ECORE_FILE_MONITOR_TYPE_INOTIFY;
|
||||||
|
@ -49,7 +49,7 @@ ecore_file_monitor_init(void)
|
||||||
int
|
int
|
||||||
ecore_file_monitor_shutdown(void)
|
ecore_file_monitor_shutdown(void)
|
||||||
{
|
{
|
||||||
if (--init > 0) return init;
|
if (--init != 0) return init;
|
||||||
|
|
||||||
switch (monitor_type)
|
switch (monitor_type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ static Ecore_List *_ecore_file_path_from_env(const char *env);
|
||||||
int
|
int
|
||||||
ecore_file_path_init(void)
|
ecore_file_path_init(void)
|
||||||
{
|
{
|
||||||
if (++init > 1) return init;
|
if (++init != 1) return init;
|
||||||
__ecore_file_path_bin = _ecore_file_path_from_env("PATH");
|
__ecore_file_path_bin = _ecore_file_path_from_env("PATH");
|
||||||
return init;
|
return init;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ ecore_file_path_init(void)
|
||||||
int
|
int
|
||||||
ecore_file_path_shutdown(void)
|
ecore_file_path_shutdown(void)
|
||||||
{
|
{
|
||||||
if (--init > 0) return init;
|
if (--init != 0) return init;
|
||||||
ecore_list_destroy(__ecore_file_path_bin);
|
ecore_list_destroy(__ecore_file_path_bin);
|
||||||
return init;
|
return init;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue