more shutdown fixes for elm_need/unneed.

SVN revision: 80258
This commit is contained in:
Gustavo Sverzut Barbieri 2012-12-05 15:13:18 +00:00
parent bab69d04cc
commit 066157cfdb
3 changed files with 21 additions and 10 deletions

View File

@ -458,7 +458,7 @@ _elm_thumb_smart_hide(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
} }
#ifdef ELM_ETHUMB #ifdef ELM_ETHUMB
static int _elm_need_ethumb = 0; static Eina_Bool _elm_need_ethumb = EINA_FALSE;
static void _on_die_cb(void *, Ethumb_Client *); static void _on_die_cb(void *, Ethumb_Client *);
static void static void
@ -493,7 +493,8 @@ void
_elm_unneed_ethumb(void) _elm_unneed_ethumb(void)
{ {
#ifdef ELM_ETHUMB #ifdef ELM_ETHUMB
if (--_elm_need_ethumb) return; if (!_elm_need_ethumb) return;
_elm_need_ethumb = EINA_FALSE;
ethumb_client_disconnect(_elm_ethumb_client); ethumb_client_disconnect(_elm_ethumb_client);
_elm_ethumb_client = NULL; _elm_ethumb_client = NULL;
@ -516,7 +517,8 @@ EAPI Eina_Bool
elm_need_ethumb(void) elm_need_ethumb(void)
{ {
#ifdef ELM_ETHUMB #ifdef ELM_ETHUMB
if (_elm_need_ethumb++) return EINA_TRUE; if (_elm_need_ethumb) return EINA_TRUE;
_elm_need_ethumb = EINA_TRUE;
ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new(); ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new();
ethumb_client_init(); ethumb_client_init();

View File

@ -1097,16 +1097,15 @@ _bring_in_anim_cb(void *data,
#endif #endif
#ifdef HAVE_ELEMENTARY_WEB #ifdef HAVE_ELEMENTARY_WEB
static int _elm_need_web = 0; static Eina_Bool _elm_need_web = EINA_FALSE;
#endif #endif
void void
_elm_unneed_web(void) _elm_unneed_web(void)
{ {
#ifdef HAVE_ELEMENTARY_WEB #ifdef HAVE_ELEMENTARY_WEB
if (--_elm_need_web) return; if (!_elm_need_web) return;
_elm_need_web = EINA_FALSE;
_elm_need_web = 0;
ewk_shutdown(); ewk_shutdown();
#endif #endif
} }
@ -1115,7 +1114,8 @@ EAPI Eina_Bool
elm_need_web(void) elm_need_web(void)
{ {
#ifdef HAVE_ELEMENTARY_WEB #ifdef HAVE_ELEMENTARY_WEB
if (_elm_need_web++) return EINA_TRUE; if (_elm_need_web) return EINA_TRUE;
_elm_need_web = EINA_TRUE;
ewk_init(); ewk_init();
return EINA_TRUE; return EINA_TRUE;
#else #else

View File

@ -85,12 +85,21 @@ _view_add(Evas_Object *parent)
return view; return view;
} }
static int _elm_need_web = 0; static Eina_Bool _elm_need_web = EINA_FALSE;
void
_elm_unneed_web(void)
{
if (!_elm_need_web) return;
_elm_need_web = EINA_FALSE;
ewk_shutdown();
}
EAPI Eina_Bool EAPI Eina_Bool
elm_need_web(void) elm_need_web(void)
{ {
if (_elm_need_web++) return EINA_TRUE; if (_elm_need_web) return EINA_TRUE;
_elm_need_web = EINA_TRUE;
ewk_init(); ewk_init();
return EINA_TRUE; return EINA_TRUE;
} }