fix 2 (possible) memory leaks

It's good practice usually to set pointers to 0 after deletion to make sure that no dangling references exist.
Especially in this case as the object itself is not going away after it (like in a destructor or when exit is called in the next line :p).