aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-06 14:02:05 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-06 14:24:23 +0900
commit5284b62e930f0bef0ed3125b3a485e0599451ef8 (patch)
tree1d195f470fb21e341cc93007b1bfd90ae9c80f9f /src
parentEfl vpath: Fix usage of @class function (diff)
downloadefl-5284b62e930f0bef0ed3125b3a485e0599451ef8.tar.gz
Eo: Fix function cache after eo reinit
The function call resolve cache may be broken after an eo shutdown + init cycle, leading to calls to invalid functions. This adds an static uint for each and every single EO API entry point, as well as an extra if() check. Now I'm not sure if the previous commit 0862b9d08384bc1d8 is still necessary.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/Eo.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eo/Eo.h b/src/lib/eo/Eo.h
index fa31fb1f85..f890b839f9 100644
--- a/src/lib/eo/Eo.h
+++ b/src/lib/eo/Eo.h
@@ -488,6 +488,7 @@ typedef struct _Eo_Call_Cache
# endif
#endif
Eo_Op op;
+ unsigned int generation;
} Eo_Call_Cache;
// to pass the internal function call to EO_FUNC_BODY (as Func parameter)
@@ -503,10 +504,12 @@ typedef struct _Eo_Call_Cache
#define EO_FUNC_COMMON_OP(Obj, Name, DefRet) \
static Eo_Call_Cache ___cache; /* static 0 by default */ \
Eo_Op_Call_Data ___call; \
- if (EINA_UNLIKELY(___cache.op == EO_NOOP)) \
+ if (EINA_UNLIKELY((___cache.op == EO_NOOP) || \
+ (___cache.generation != _eo_init_generation))) \
{ \
___cache.op = _eo_api_op_id_get(EO_FUNC_COMMON_OP_FUNC(Name)); \
if (___cache.op == EO_NOOP) return DefRet; \
+ ___cache.generation = _eo_init_generation; \
} \
if (!_eo_call_resolve((Eo *) Obj, #Name, &___call, &___cache, \
__FILE__, __LINE__)) return DefRet; \