This should make sure that the memory context is not destroyed before the memory pool, which is using the context.