Fix crash in destructor

Pointer was uninitialized, causing crash while deleting it.