In which case the C++ this pointer can be NULL

I experienced an issue that in the class constructor while I was using this pointer, but this pointer happen to be NULL at that time.
for example

MyClass::MyClass()
{
   //this pointer happen to be NULL in this case, and it crash in teh m_callbackfunc because it does not handle null input.
   m_callbackFunc(this);
}

I wonder why this pointer can be null? and in which case this pointer can be null?


Source: c++

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.