cleanup from deleting the memory manager.
trq-2378 Check ptask for NULL before dereferencing it.