bugfix: Whenever deleting m_log, verify that it is not null. Change to null after delete.

This fixes a double-free in cases of inheritance.