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.
Merge pull request #296 from Astron/bugfix/double-free-m_log

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