mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 09:40:49 +00:00
Merge pull request #25835 from kitaisreal/expression-cache-destruction-fix
ExpressionCache destruction fix
This commit is contained in:
commit
e0d04edade
@ -457,6 +457,14 @@ struct ContextSharedPart
|
||||
{
|
||||
auto lock = std::lock_guard(mutex);
|
||||
|
||||
/** Compiled expressions stored in cache need to be destroyed before destruction of static objects.
|
||||
* Because CHJIT instance can be static object.
|
||||
*/
|
||||
#if USE_EMBEDDED_COMPILER
|
||||
if (auto * cache = CompiledExpressionCacheFactory::instance().tryGetCache())
|
||||
cache->reset();
|
||||
#endif
|
||||
|
||||
/// Preemptive destruction is important, because these objects may have a refcount to ContextShared (cyclic reference).
|
||||
/// TODO: Get rid of this.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user