fixed memory leak in Q3.cpp