I have an array in C++:
Player ** playerArray;
which is initialized in the constructor of the class it is in.
In the destructor I have:
delete playerArray;
except when testing the program through Valgrind it says that there are some calls to delete to a void pointer:
operator delete(void*)
I want to test whether the playerArray is a void pointer before calling delete to avoid this error.
Does anyone know how to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…