diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-12-18 12:25:59 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-12-18 19:54:31 +0900 |
commit | fce444bb188d1873d9fb4482811058418588cd6b (patch) | |
tree | 6dd644e587d22c4e64a56c05d27f9715107b46ed | |
parent | c0c5e72408f43206bdf428431e2a24446f8b9875 (diff) | |
download | efl-fce444bb188d1873d9fb4482811058418588cd6b.tar.gz |
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.
-rw-r--r-- | src/lib/ecore_con/ecore_con_proxy_helper.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/ecore_con/ecore_con_proxy_helper.c b/src/lib/ecore_con/ecore_con_proxy_helper.c index c313b4d4f7..f99c7a225b 100644 --- a/src/lib/ecore_con/ecore_con_proxy_helper.c +++ b/src/lib/ecore_con/ecore_con_proxy_helper.c @@ -53,6 +53,16 @@ static int locks = 0; #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) { char buf[PATH_MAX]; @@ -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 |