diff --git a/src/core/include/megbrain/utils/thread_local.h b/src/core/include/megbrain/utils/thread_local.h index fd62d12073bbb810b3926672786f35753a98a8e7..3b968e02b35e5cc3746480585747a2043cd3b0a2 100644 --- a/src/core/include/megbrain/utils/thread_local.h +++ b/src/core/include/megbrain/utils/thread_local.h @@ -18,6 +18,12 @@ # endif #endif +#if defined(__ANDROID__) +#pragma message("force disable USE_STL_THREAD_LOCAL for thread_local mem leak at dlopen/dlclose") +#undef USE_STL_THREAD_LOCAL +#define USE_STL_THREAD_LOCAL 0 +#endif + #if USE_STL_THREAD_LOCAL #define MGB_THREAD_LOCAL_PTR(T) thread_local T* #else