What will happens to a local pointer if thread is terminated?

  c++, memory

what happens to data created in local scope of thread if thread is terminated, memory leak?

void MyThread()
{
    auto* ptr = new int[10];

    while (true)
    {
        // stuff
    }

    // thread is interrupted before this delete
    delete[] ptr;
}

Source: Windows Questions C++

LEAVE A COMMENT