This is a small change, so I won't changelog it (or backport), but

make _shutdown() funcs across efl complain and be unhappy if you
shutdown to < 0 shutdowns and not pull init count below 0.



SVN revision: 71548
This commit is contained in:
Carsten Haitzler 2012-05-30 10:08:41 +00:00
parent b5e054507a
commit 318bd30043
11 changed files with 57 additions and 0 deletions

View File

@ -228,6 +228,12 @@ ecore_shutdown(void)
* take a lock here because _ecore_event_shutdown() does callbacks
*/
_ecore_lock();
if (_ecore_init_count <= 0)
{
ERR("Init count not greater than 0 in shutdown.");
_ecore_unlock();
return 0;
}
if (--_ecore_init_count != 0)
goto unlock;

View File

@ -170,6 +170,11 @@ _edje_lib_unref(void)
EAPI int
edje_shutdown(void)
{
if (_edje_init_count <= 0)
{
ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--_edje_init_count != 0)
return _edje_init_count;

View File

@ -633,6 +633,11 @@ shutdown_eina:
EAPI int
eet_shutdown(void)
{
if (eet_init_count <= 0)
{
ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--eet_init_count != 0)
return eet_init_count;

View File

@ -82,6 +82,11 @@ eina_fail:
EAPI int
eeze_shutdown(void)
{
if (_eeze_init_count <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--_eeze_init_count != 0)
return _eeze_init_count;

View File

@ -136,6 +136,11 @@ shutdown_eina:
EAPI int
efreet_shutdown(void)
{
if (_efreet_init_count <= 0)
{
ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--_efreet_init_count != 0)
return _efreet_init_count;

View File

@ -307,6 +307,11 @@ eina_init(void)
EAPI int
eina_shutdown(void)
{
if (_eina_main_count <= 0)
{
ERR("Init count not greater than 0 in shutdown.");
return 0;
}
_eina_main_count--;
if (EINA_UNLIKELY(_eina_main_count == 0))
{

View File

@ -236,6 +236,11 @@ eio_shutdown(void)
Eio_Progress *pg;
Eio_File_Associate *asso;
if (_eio_count <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return 0;
}
_eio_count--;
if (_eio_count > 0) return _eio_count;

View File

@ -2,6 +2,7 @@
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@ -29,6 +30,11 @@ embryo_init(void)
EAPI int
embryo_shutdown(void)
{
if (_embryo_init_count <= 0)
{
printf("%s:%i Init count not greater than 0 in shutdown.", __FUNCTION__, __LINE__);
return 0;
}
if (--_embryo_init_count != 0)
return _embryo_init_count;

View File

@ -383,6 +383,11 @@ emotion_shutdown(void)
{
Emotion_Webcam *ew;
if (_emotion_webcams_count <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return EINA_FALSE;
}
if (--_emotion_webcams_count) return EINA_TRUE;
EINA_LIST_FREE(_emotion_webcams->webcams, ew)

View File

@ -202,6 +202,11 @@ ethumb_init(void)
EAPI int
ethumb_shutdown(void)
{
if (initcount <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return 0;
}
initcount--;
if (initcount == 0)
{

View File

@ -77,6 +77,11 @@ evas_init(void)
EAPI int
evas_shutdown(void)
{
if (_evas_init_count <= 0)
{
EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
return 0;
}
if (--_evas_init_count != 0)
return _evas_init_count;