So I stumbled upon this bit of code and while I've been coding in C/C++ for about 5 years now, I cannot fathom why anybody would want to do this. I understand why you'd want to set the pointer to NULL
after deallocating memory, but I certainly don't understand why someone would want to do the opposite (looks like a memory leak to me).
Second, I'm pretty sure it's not necessary to check if the pointer is NULL
before setting it to NULL and deleting it, as discussed here.
if( m_pio )
{
m_pio = NULL;
delete m_pio;
}