Is it safe to delete a NULL pointer?
And is it a good coding style?
To complement ruslik's answer, in C++14 you can use this construction:
delete std::exchange(heapObject, nullptr);