Add a comment

This commit is contained in:
Dmitry Novik 2023-02-21 22:02:23 +00:00
parent 93aabf8c66
commit 8232966b9e

View File

@ -91,6 +91,9 @@ private:
~InsertData()
{
auto it = entries.begin();
// Entries must be destroyed in context of user who runs async insert.
// Each entry in the list may correspond to a different user,
// so we need to switch current thread's MemoryTracker parent on each iteration.
while (it != entries.end())
{
UserMemoryTrackerSwitcher switcher((*it)->user_memory_tracker);