forked from enlightenment/efl
ecore_con: Make sure the proxy helper is valid
If the http proxy helper gets deleted at shutdown rather than because the process actually exited, the object pointer becomes invalid. This patch tries to avoid a situation where the object is not valid.
This commit is contained in:
parent
c0c5e72408
commit
fce444bb18
|
@ -52,6 +52,16 @@ static int locks = 0;
|
|||
# define HELPER_EXT
|
||||
#endif
|
||||
|
||||
static void
|
||||
_efl_net_proxy_helper_delete_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
||||
{
|
||||
if (ev->object == _efl_net_proxy_helper_exe)
|
||||
{
|
||||
INF("HTTP proxy helper object died before the process exited.");
|
||||
_efl_net_proxy_helper_exe = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_efl_net_proxy_helper_spawn(void)
|
||||
{
|
||||
|
@ -102,6 +112,8 @@ _efl_net_proxy_helper_spawn(void)
|
|||
locks--;
|
||||
}
|
||||
eina_spinlock_release(&_efl_net_proxy_helper_queue_lock);
|
||||
efl_event_callback_add(_efl_net_proxy_helper_exe, EFL_EVENT_DEL,
|
||||
_efl_net_proxy_helper_delete_cb, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue