Fix destruction order problem in getCoreAllocator